From bdc8d8a2c3c92ecf6e40ce008328b73bc3a03984 Mon Sep 17 00:00:00 2001 From: alexander Date: Mon, 8 Jun 2020 12:44:12 -0700 Subject: [PATCH 1/5] Added an option to disable pre-mining rules --- corels/_corels.cpp | 848 +++++++++++++++++++++++-------------------- corels/_corels.pyx | 6 +- corels/corels.py | 7 +- corels/src/utils.cpp | 147 ++++---- corels/src/utils.hh | 2 +- 5 files changed, 543 insertions(+), 467 deletions(-) diff --git a/corels/_corels.cpp b/corels/_corels.cpp index 8722bfa..5d1902f 100644 --- a/corels/_corels.cpp +++ b/corels/_corels.cpp @@ -1,28 +1,4 @@ -/* Generated by Cython 0.29.14 */ - -/* BEGIN: Cython Metadata -{ - "distutils": { - "depends": [ - "/home/vassy/code/pycorels/corels/src/corels/src/cache.hh", - "/home/vassy/code/pycorels/corels/src/corels/src/pmap.hh", - "/home/vassy/code/pycorels/corels/src/corels/src/queue.hh", - "/home/vassy/code/pycorels/corels/src/corels/src/rule.hh", - "/home/vassy/code/pycorels/corels/src/corels/src/run.hh", - "/home/vassy/code/pycorels/corels/src/utils.hh" - ], - "include_dirs": [ - "/home/vassy/code/pycorels/corels" - ], - "language": "c++", - "name": "corels._corels", - "sources": [ - "/home/vassy/code/pycorels/corels/_corels.pyx" - ] - }, - "module_name": "corels._corels" -} -END: Cython Metadata */ +/* Generated by Cython 0.29.19 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -31,8 +7,8 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_14" -#define CYTHON_HEX_VERSION 0x001D0EF0 +#define CYTHON_ABI "0_29_19" +#define CYTHON_HEX_VERSION 0x001D13F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof @@ -522,8 +498,10 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact +#ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif +#endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) @@ -614,11 +592,10 @@ static CYTHON_INLINE float __PYX_NAN() { #define __Pyx_truncl truncl #endif - +#define __PYX_MARK_ERR_POS(f_index, lineno) \ + { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ -{ \ - __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ -} + { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifndef __PYX_EXTERN_C #ifdef __cplusplus @@ -639,6 +616,17 @@ static CYTHON_INLINE float __PYX_NAN() { #include "typeinfo" #include #include + + #if __cplusplus > 199711L + #include + + namespace cython_std { + template typename std::remove_reference::type&& move(T& t) noexcept { return std::move(t); } + template typename std::remove_reference::type&& move(T&& t) noexcept { return std::move(t); } + } + + #endif + #include #include #include @@ -921,7 +909,7 @@ typedef struct { } __Pyx_BufFmt_Context; -/* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":776 +/* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< @@ -930,7 +918,7 @@ typedef struct { */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777 +/* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< @@ -939,7 +927,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":778 +/* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":777 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -948,7 +936,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":779 +/* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -957,7 +945,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783 +/* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":782 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< @@ -966,7 +954,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":784 +/* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":783 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< @@ -975,7 +963,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":785 +/* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -984,7 +972,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":786 +/* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":785 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -993,7 +981,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":790 +/* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":789 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< @@ -1002,7 +990,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":791 +/* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< @@ -1011,7 +999,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":800 +/* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":799 * # The int types are mapped a bit surprising -- * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t # <<<<<<<<<<<<<< @@ -1020,7 +1008,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t; */ typedef npy_long __pyx_t_5numpy_int_t; -/* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801 +/* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":800 * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< @@ -1029,7 +1017,7 @@ typedef npy_long __pyx_t_5numpy_int_t; */ typedef npy_longlong __pyx_t_5numpy_long_t; -/* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":802 +/* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801 * ctypedef npy_long int_t * ctypedef npy_longlong long_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< @@ -1038,7 +1026,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t; */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":804 +/* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":803 * ctypedef npy_longlong longlong_t * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< @@ -1047,7 +1035,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":805 +/* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":804 * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< @@ -1056,7 +1044,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; -/* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":806 +/* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< @@ -1065,7 +1053,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":808 +/* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":807 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< @@ -1074,7 +1062,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":809 +/* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":808 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< @@ -1083,7 +1071,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":811 +/* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< @@ -1092,7 +1080,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":812 +/* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":811 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< @@ -1101,7 +1089,7 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":813 +/* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< @@ -1136,7 +1124,7 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do /*--- Type declarations ---*/ -/* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":815 +/* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 * ctypedef npy_longdouble longdouble_t * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< @@ -1145,7 +1133,7 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; -/* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":816 +/* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":815 * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< @@ -1154,7 +1142,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":817 +/* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":816 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< @@ -1163,7 +1151,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":819 +/* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":818 * ctypedef npy_clongdouble clongdouble_t * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< @@ -1857,6 +1845,7 @@ static const char __pyx_k_features[] = "features"; static const char __pyx_k_map_type[] = "map_type"; static const char __pyx_k_max_card[] = "max_card"; static const char __pyx_k_nsamples[] = "nsamples"; +static const char __pyx_k_pre_mine[] = "pre_mine"; static const char __pyx_k_rulelist[] = "rulelist"; static const char __pyx_k_max_nodes[] = "max_nodes"; static const char __pyx_k_next_rule[] = "next_rule"; @@ -1969,6 +1958,7 @@ static PyObject *__pyx_kp_u_numpy_core_multiarray_failed_to; static PyObject *__pyx_kp_u_numpy_core_umath_failed_to_impor; static PyObject *__pyx_n_s_out; static PyObject *__pyx_n_s_policy; +static PyObject *__pyx_n_s_pre_mine; static PyObject *__pyx_n_s_predict_wrap; static PyObject *__pyx_n_u_prediction; static PyObject *__pyx_n_s_predictions; @@ -1990,7 +1980,7 @@ static PyObject *__pyx_n_s_verbosity_ascii; static PyObject *__pyx_n_s_verbosity_str; static PyObject *__pyx_n_s_zeros; static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_X, PyObject *__pyx_v_rules); /* proto */ -static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_samples, PyArrayObject *__pyx_v_labels, PyObject *__pyx_v_features, int __pyx_v_max_card, double __pyx_v_min_support, PyObject *__pyx_v_verbosity_str, int __pyx_v_mine_verbose, int __pyx_v_minor_verbose, double __pyx_v_c, int __pyx_v_policy, int __pyx_v_map_type, int __pyx_v_ablation, int __pyx_v_calculate_size); /* proto */ +static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_samples, PyArrayObject *__pyx_v_labels, PyObject *__pyx_v_features, int __pyx_v_max_card, double __pyx_v_min_support, PyObject *__pyx_v_verbosity_str, int __pyx_v_mine_verbose, int __pyx_v_minor_verbose, double __pyx_v_c, int __pyx_v_policy, int __pyx_v_map_type, int __pyx_v_ablation, int __pyx_v_calculate_size, int __pyx_v_pre_mine); /* proto */ static PyObject *__pyx_pf_6corels_7_corels_4fit_wrap_loop(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_max_nodes); /* proto */ static PyObject *__pyx_pf_6corels_7_corels_6fit_wrap_end(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_early); /* proto */ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ @@ -2028,6 +2018,9 @@ static PyMethodDef __pyx_mdef_6corels_7_corels_1predict_wrap = {"predict_wrap", static PyObject *__pyx_pw_6corels_7_corels_1predict_wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyArrayObject *__pyx_v_X = 0; PyObject *__pyx_v_rules = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("predict_wrap (wrapper)", 0); @@ -2128,6 +2121,9 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * int __pyx_t_17; Py_ssize_t __pyx_t_18; Py_ssize_t __pyx_t_19; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; __Pyx_RefNannySetupContext("predict_wrap", 0); __pyx_pybuffer_X.pybuffer.buf = NULL; __pyx_pybuffer_X.refcount = 0; @@ -2736,6 +2732,9 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int PyObject *__pyx_t_10 = NULL; char *__pyx_t_11; Py_ssize_t __pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_to_vector", 0); __pyx_pybuffer_X.pybuffer.buf = NULL; __pyx_pybuffer_X.refcount = 0; @@ -3409,16 +3408,22 @@ static PyObject *__pyx_pw_6corels_7_corels_3fit_wrap_begin(PyObject *__pyx_self, int __pyx_v_map_type; int __pyx_v_ablation; int __pyx_v_calculate_size; + int __pyx_v_pre_mine; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fit_wrap_begin (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_samples,&__pyx_n_s_labels,&__pyx_n_s_features,&__pyx_n_s_max_card,&__pyx_n_s_min_support,&__pyx_n_s_verbosity_str,&__pyx_n_s_mine_verbose,&__pyx_n_s_minor_verbose,&__pyx_n_s_c,&__pyx_n_s_policy,&__pyx_n_s_map_type,&__pyx_n_s_ablation,&__pyx_n_s_calculate_size,0}; - PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_samples,&__pyx_n_s_labels,&__pyx_n_s_features,&__pyx_n_s_max_card,&__pyx_n_s_min_support,&__pyx_n_s_verbosity_str,&__pyx_n_s_mine_verbose,&__pyx_n_s_minor_verbose,&__pyx_n_s_c,&__pyx_n_s_policy,&__pyx_n_s_map_type,&__pyx_n_s_ablation,&__pyx_n_s_calculate_size,&__pyx_n_s_pre_mine,0}; + PyObject* values[14] = {0,0,0,0,0,0,0,0,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 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + CYTHON_FALLTHROUGH; case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); CYTHON_FALLTHROUGH; case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); @@ -3457,79 +3462,85 @@ static PyObject *__pyx_pw_6corels_7_corels_3fit_wrap_begin(PyObject *__pyx_self, case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 13, 13, 1); __PYX_ERR(0, 179, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 14, 14, 1); __PYX_ERR(0, 179, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_features)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 13, 13, 2); __PYX_ERR(0, 179, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 14, 14, 2); __PYX_ERR(0, 179, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_card)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 13, 13, 3); __PYX_ERR(0, 179, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 14, 14, 3); __PYX_ERR(0, 179, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_support)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 13, 13, 4); __PYX_ERR(0, 179, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 14, 14, 4); __PYX_ERR(0, 179, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_verbosity_str)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 13, 13, 5); __PYX_ERR(0, 179, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 14, 14, 5); __PYX_ERR(0, 179, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mine_verbose)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 13, 13, 6); __PYX_ERR(0, 179, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 14, 14, 6); __PYX_ERR(0, 179, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minor_verbose)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 13, 13, 7); __PYX_ERR(0, 179, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 14, 14, 7); __PYX_ERR(0, 179, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 8: if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_c)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 13, 13, 8); __PYX_ERR(0, 179, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 14, 14, 8); __PYX_ERR(0, 179, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 9: if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_policy)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 13, 13, 9); __PYX_ERR(0, 179, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 14, 14, 9); __PYX_ERR(0, 179, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 10: if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_map_type)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 13, 13, 10); __PYX_ERR(0, 179, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 14, 14, 10); __PYX_ERR(0, 179, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 11: if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ablation)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 13, 13, 11); __PYX_ERR(0, 179, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 14, 14, 11); __PYX_ERR(0, 179, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 12: if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_calculate_size)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 13, 13, 12); __PYX_ERR(0, 179, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 14, 14, 12); __PYX_ERR(0, 179, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 13: + if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pre_mine)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 14, 14, 13); __PYX_ERR(0, 179, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fit_wrap_begin") < 0)) __PYX_ERR(0, 179, __pyx_L3_error) } - } else if (PyTuple_GET_SIZE(__pyx_args) != 13) { + } else if (PyTuple_GET_SIZE(__pyx_args) != 14) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); @@ -3545,6 +3556,7 @@ static PyObject *__pyx_pw_6corels_7_corels_3fit_wrap_begin(PyObject *__pyx_self, values[10] = PyTuple_GET_ITEM(__pyx_args, 10); values[11] = PyTuple_GET_ITEM(__pyx_args, 11); values[12] = PyTuple_GET_ITEM(__pyx_args, 12); + values[13] = PyTuple_GET_ITEM(__pyx_args, 13); } __pyx_v_samples = ((PyArrayObject *)values[0]); __pyx_v_labels = ((PyArrayObject *)values[1]); @@ -3559,10 +3571,11 @@ static PyObject *__pyx_pw_6corels_7_corels_3fit_wrap_begin(PyObject *__pyx_self, __pyx_v_map_type = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_map_type == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L3_error) __pyx_v_ablation = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_ablation == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L3_error) __pyx_v_calculate_size = __Pyx_PyInt_As_int(values[12]); if (unlikely((__pyx_v_calculate_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 183, __pyx_L3_error) + __pyx_v_pre_mine = __Pyx_PyInt_As_int(values[13]); if (unlikely((__pyx_v_pre_mine == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 183, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 13, 13, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 179, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 14, 14, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 179, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("corels._corels.fit_wrap_begin", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -3570,7 +3583,7 @@ static PyObject *__pyx_pw_6corels_7_corels_3fit_wrap_begin(PyObject *__pyx_self, __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_samples), __pyx_ptype_5numpy_ndarray, 1, "samples", 0))) __PYX_ERR(0, 179, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 180, __pyx_L1_error) - __pyx_r = __pyx_pf_6corels_7_corels_2fit_wrap_begin(__pyx_self, __pyx_v_samples, __pyx_v_labels, __pyx_v_features, __pyx_v_max_card, __pyx_v_min_support, __pyx_v_verbosity_str, __pyx_v_mine_verbose, __pyx_v_minor_verbose, __pyx_v_c, __pyx_v_policy, __pyx_v_map_type, __pyx_v_ablation, __pyx_v_calculate_size); + __pyx_r = __pyx_pf_6corels_7_corels_2fit_wrap_begin(__pyx_self, __pyx_v_samples, __pyx_v_labels, __pyx_v_features, __pyx_v_max_card, __pyx_v_min_support, __pyx_v_verbosity_str, __pyx_v_mine_verbose, __pyx_v_minor_verbose, __pyx_v_c, __pyx_v_policy, __pyx_v_map_type, __pyx_v_ablation, __pyx_v_calculate_size, __pyx_v_pre_mine); /* function exit code */ goto __pyx_L0; @@ -3581,7 +3594,7 @@ static PyObject *__pyx_pw_6corels_7_corels_3fit_wrap_begin(PyObject *__pyx_self, return __pyx_r; } -static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_samples, PyArrayObject *__pyx_v_labels, PyObject *__pyx_v_features, int __pyx_v_max_card, double __pyx_v_min_support, PyObject *__pyx_v_verbosity_str, int __pyx_v_mine_verbose, int __pyx_v_minor_verbose, double __pyx_v_c, int __pyx_v_policy, int __pyx_v_map_type, int __pyx_v_ablation, int __pyx_v_calculate_size) { +static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_samples, PyArrayObject *__pyx_v_labels, PyObject *__pyx_v_features, int __pyx_v_max_card, double __pyx_v_min_support, PyObject *__pyx_v_verbosity_str, int __pyx_v_mine_verbose, int __pyx_v_minor_verbose, double __pyx_v_c, int __pyx_v_policy, int __pyx_v_map_type, int __pyx_v_ablation, int __pyx_v_calculate_size, int __pyx_v_pre_mine) { int __pyx_v_nfeatures; rule_t *__pyx_v_samples_vecs; PyObject *__pyx_v_nsamples = NULL; @@ -3618,6 +3631,9 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fit_wrap_begin", 0); __pyx_pybuffer_samples.pybuffer.buf = NULL; __pyx_pybuffer_samples.refcount = 0; @@ -4082,7 +4098,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec * n_rules = 0 * * cdef int r = mine_rules(features_vec, samples_vecs, nfeatures, nsamples, # <<<<<<<<<<<<<< - * max_card, min_support, &rules, mine_verbose) + * max_card, min_support, &rules, mine_verbose, pre_mine) * */ __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_nsamples); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 226, __pyx_L1_error) @@ -4090,14 +4106,14 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec /* "corels/_corels.pyx":227 * * cdef int r = mine_rules(features_vec, samples_vecs, nfeatures, nsamples, - * max_card, min_support, &rules, mine_verbose) # <<<<<<<<<<<<<< + * max_card, min_support, &rules, mine_verbose, pre_mine) # <<<<<<<<<<<<<< * * if features_vec != NULL: */ - __pyx_v_r = mine_rules(__pyx_v_features_vec, __pyx_v_samples_vecs, __pyx_v_nfeatures, __pyx_t_4, __pyx_v_max_card, __pyx_v_min_support, (&__pyx_v_6corels_7_corels_rules), __pyx_v_mine_verbose); + __pyx_v_r = mine_rules(__pyx_v_features_vec, __pyx_v_samples_vecs, __pyx_v_nfeatures, __pyx_t_4, __pyx_v_max_card, __pyx_v_min_support, (&__pyx_v_6corels_7_corels_rules), __pyx_v_mine_verbose, __pyx_v_pre_mine); /* "corels/_corels.pyx":229 - * max_card, min_support, &rules, mine_verbose) + * max_card, min_support, &rules, mine_verbose, pre_mine) * * if features_vec != NULL: # <<<<<<<<<<<<<< * for i in range(nfeatures): @@ -4166,7 +4182,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_v_features_vec = NULL; /* "corels/_corels.pyx":229 - * max_card, min_support, &rules, mine_verbose) + * max_card, min_support, &rules, mine_verbose, pre_mine) * * if features_vec != NULL: # <<<<<<<<<<<<<< * for i in range(nfeatures): @@ -5217,6 +5233,9 @@ static PyObject *__pyx_pw_6corels_7_corels_5fit_wrap_loop(PyObject *__pyx_self, static PyMethodDef __pyx_mdef_6corels_7_corels_5fit_wrap_loop = {"fit_wrap_loop", (PyCFunction)__pyx_pw_6corels_7_corels_5fit_wrap_loop, METH_O, 0}; static PyObject *__pyx_pw_6corels_7_corels_5fit_wrap_loop(PyObject *__pyx_self, PyObject *__pyx_arg_max_nodes) { size_t __pyx_v_max_nodes; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fit_wrap_loop (wrapper)", 0); @@ -5241,6 +5260,9 @@ static PyObject *__pyx_pf_6corels_7_corels_4fit_wrap_loop(CYTHON_UNUSED PyObject PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fit_wrap_loop", 0); /* "corels/_corels.pyx":340 @@ -5298,6 +5320,9 @@ static PyObject *__pyx_pw_6corels_7_corels_7fit_wrap_end(PyObject *__pyx_self, P static PyMethodDef __pyx_mdef_6corels_7_corels_7fit_wrap_end = {"fit_wrap_end", (PyCFunction)__pyx_pw_6corels_7_corels_7fit_wrap_end, METH_O, 0}; static PyObject *__pyx_pw_6corels_7_corels_7fit_wrap_end(PyObject *__pyx_self, PyObject *__pyx_arg_early) { int __pyx_v_early; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fit_wrap_end (wrapper)", 0); @@ -5335,6 +5360,9 @@ static PyObject *__pyx_pf_6corels_7_corels_6fit_wrap_end(CYTHON_UNUSED PyObject int __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("fit_wrap_end", 0); /* "corels/_corels.pyx":352 @@ -5684,7 +5712,7 @@ static PyObject *__pyx_pf_6corels_7_corels_6fit_wrap_end(CYTHON_UNUSED PyObject return __pyx_r; } -/* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":258 +/* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":258 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -5725,6 +5753,9 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P PyArray_Descr *__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; if (__pyx_v_info == NULL) { PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete"); return -1; @@ -5733,7 +5764,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_info->obj); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":265 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265 * * cdef int i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -5742,7 +5773,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_endian_detector = 1; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":266 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":266 * cdef int i, ndim * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -5751,7 +5782,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":268 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":268 * cdef bint little_endian = ((&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< @@ -5760,7 +5791,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":270 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270 * ndim = PyArray_NDIM(self) * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -5774,7 +5805,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L4_bool_binop_done; } - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":271 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":271 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -5785,7 +5816,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":270 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270 * ndim = PyArray_NDIM(self) * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -5794,7 +5825,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (unlikely(__pyx_t_1)) { - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":272 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< @@ -5807,7 +5838,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 272, __pyx_L1_error) - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":270 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270 * ndim = PyArray_NDIM(self) * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -5816,7 +5847,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -5830,7 +5861,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L7_bool_binop_done; } - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":275 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275 * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -5841,7 +5872,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L7_bool_binop_done:; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -5850,7 +5881,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (unlikely(__pyx_t_1)) { - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":276 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< @@ -5863,7 +5894,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 276, __pyx_L1_error) - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -5872,7 +5903,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":278 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278 * raise ValueError(u"ndarray is not Fortran contiguous") * * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< @@ -5881,7 +5912,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":279 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -5890,7 +5921,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":280 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -5900,7 +5931,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":283 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283 * # Allocate new buffer for strides and shape info. * # This is allocated as one block, strides first. * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) # <<<<<<<<<<<<<< @@ -5909,7 +5940,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim)))); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":284 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284 * # This is allocated as one block, strides first. * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) * info.shape = info.strides + ndim # <<<<<<<<<<<<<< @@ -5918,7 +5949,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":285 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":285 * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) * info.shape = info.strides + ndim * for i in range(ndim): # <<<<<<<<<<<<<< @@ -5930,7 +5961,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":286 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":286 * info.shape = info.strides + ndim * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< @@ -5939,7 +5970,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":287 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":287 * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< @@ -5949,7 +5980,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); } - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":280 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -5959,7 +5990,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L9; } - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":289 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":289 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< @@ -5969,7 +6000,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P /*else*/ { __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":290 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":290 * else: * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -5980,7 +6011,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L9:; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":291 * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -5989,7 +6020,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->suboffsets = NULL; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":292 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292 * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< @@ -5998,7 +6029,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":293 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":293 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< @@ -6007,7 +6038,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":296 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":296 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< @@ -6016,7 +6047,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_f = NULL; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":297 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 * cdef int t * cdef char* f = NULL * cdef dtype descr = PyArray_DESCR(self) # <<<<<<<<<<<<<< @@ -6029,7 +6060,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); __pyx_t_3 = 0; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":300 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":300 * cdef int offset * * info.obj = self # <<<<<<<<<<<<<< @@ -6042,7 +6073,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = ((PyObject *)__pyx_v_self); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":302 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":302 * info.obj = self * * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<< @@ -6052,7 +6083,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0); if (__pyx_t_1) { - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":303 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":303 * * if not PyDataType_HASFIELDS(descr): * t = descr.type_num # <<<<<<<<<<<<<< @@ -6062,7 +6093,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_4 = __pyx_v_descr->type_num; __pyx_v_t = __pyx_t_4; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":304 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304 * if not PyDataType_HASFIELDS(descr): * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -6082,7 +6113,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L15_next_or:; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":305 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":305 * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -6099,7 +6130,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L14_bool_binop_done:; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":304 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304 * if not PyDataType_HASFIELDS(descr): * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -6108,7 +6139,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (unlikely(__pyx_t_1)) { - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":306 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":306 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -6121,7 +6152,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 306, __pyx_L1_error) - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":304 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304 * if not PyDataType_HASFIELDS(descr): * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -6130,7 +6161,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":307 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":307 * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< @@ -6143,7 +6174,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_UBYTE: - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":308 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":308 * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< @@ -6154,7 +6185,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_SHORT: - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":309 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":309 * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< @@ -6165,7 +6196,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_USHORT: - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":310 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":310 * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< @@ -6176,7 +6207,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_INT: - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":311 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":311 * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< @@ -6187,7 +6218,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_UINT: - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":312 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":312 * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< @@ -6198,7 +6229,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_LONG: - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":313 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":313 * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< @@ -6209,7 +6240,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_ULONG: - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":314 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":314 * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< @@ -6220,7 +6251,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_LONGLONG: - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":315 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":315 * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< @@ -6231,7 +6262,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_ULONGLONG: - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":316 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":316 * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< @@ -6242,7 +6273,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_FLOAT: - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":317 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":317 * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< @@ -6253,7 +6284,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_DOUBLE: - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":318 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":318 * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< @@ -6264,7 +6295,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_LONGDOUBLE: - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":319 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":319 * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< @@ -6275,7 +6306,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_CFLOAT: - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":320 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":320 * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< @@ -6286,7 +6317,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_CDOUBLE: - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":321 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":321 * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< @@ -6297,7 +6328,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_CLONGDOUBLE: - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":322 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":322 * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< @@ -6308,7 +6339,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; case NPY_OBJECT: - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":323 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":323 * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< @@ -6319,7 +6350,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; default: - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":325 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":325 * elif t == NPY_OBJECT: f = "O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< @@ -6340,7 +6371,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; } - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":326 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":326 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -6349,7 +6380,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->format = __pyx_v_f; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":327 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":327 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -6359,7 +6390,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_r = 0; goto __pyx_L0; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":302 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":302 * info.obj = self * * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<< @@ -6368,7 +6399,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":329 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":329 * return * else: * info.format = PyObject_Malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< @@ -6378,7 +6409,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P /*else*/ { __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF)); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":330 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":330 * else: * info.format = PyObject_Malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< @@ -6387,7 +6418,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->format[0]) = '^'; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":331 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":331 * info.format = PyObject_Malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 # <<<<<<<<<<<<<< @@ -6396,7 +6427,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_offset = 0; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":332 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":332 * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< @@ -6406,7 +6437,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(1, 332, __pyx_L1_error) __pyx_v_f = __pyx_t_9; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":335 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":335 * info.format + _buffer_format_string_len, * &offset) * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< @@ -6416,7 +6447,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_f[0]) = '\x00'; } - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":258 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":258 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -6448,7 +6479,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P return __pyx_r; } -/* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":337 +/* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":337 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -6472,7 +6503,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s int __pyx_t_1; __Pyx_RefNannySetupContext("__releasebuffer__", 0); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":338 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":338 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -6482,7 +6513,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); if (__pyx_t_1) { - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":339 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":339 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * PyObject_Free(info.format) # <<<<<<<<<<<<<< @@ -6491,7 +6522,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ PyObject_Free(__pyx_v_info->format); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":338 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":338 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -6500,7 +6531,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ } - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":340 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":340 * if PyArray_HASFIELDS(self): * PyObject_Free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -6510,7 +6541,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":341 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":341 * PyObject_Free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * PyObject_Free(info.strides) # <<<<<<<<<<<<<< @@ -6519,7 +6550,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ PyObject_Free(__pyx_v_info->strides); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":340 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":340 * if PyArray_HASFIELDS(self): * PyObject_Free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -6528,7 +6559,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ } - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":337 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":337 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -6540,7 +6571,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __Pyx_RefNannyFinishContext(); } -/* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":821 +/* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":820 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -6552,9 +6583,12 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ PyObject *__pyx_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); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":822 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":821 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -6562,13 +6596,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ * 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_ERR(1, 822, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 821, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":821 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":820 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -6587,7 +6621,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":824 +/* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":823 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -6599,9 +6633,12 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ PyObject *__pyx_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); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":825 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -6609,13 +6646,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ * 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_ERR(1, 825, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 824, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":824 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":823 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -6634,7 +6671,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":827 +/* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":826 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -6646,9 +6683,12 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ PyObject *__pyx_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); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":828 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -6656,13 +6696,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ * 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_ERR(1, 828, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":827 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":826 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -6681,7 +6721,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":830 +/* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":829 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -6693,9 +6733,12 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ PyObject *__pyx_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); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":831 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":830 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -6703,13 +6746,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ * 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_ERR(1, 831, __pyx_L1_error) + __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_ERR(1, 830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":830 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":829 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -6728,7 +6771,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":833 +/* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":832 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -6740,9 +6783,12 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ PyObject *__pyx_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); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":834 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -6750,13 +6796,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ * cdef inline tuple PyDataType_SHAPE(dtype d): */ __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_ERR(1, 834, __pyx_L1_error) + __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_ERR(1, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":833 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":832 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -6775,7 +6821,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":836 +/* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":835 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -6789,7 +6835,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ int __pyx_t_1; __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":837 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":836 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -6799,7 +6845,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0); if (__pyx_t_1) { - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":838 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837 * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): * return d.subarray.shape # <<<<<<<<<<<<<< @@ -6811,7 +6857,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); goto __pyx_L0; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":837 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":836 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -6820,7 +6866,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ */ } - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":840 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":839 * return d.subarray.shape * else: * return () # <<<<<<<<<<<<<< @@ -6834,7 +6880,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ goto __pyx_L0; } - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":836 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":835 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -6849,7 +6895,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ return __pyx_r; } -/* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":842 +/* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":841 * return () * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -6876,9 +6922,12 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx int __pyx_t_7; long __pyx_t_8; char *__pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_util_dtypestring", 0); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":847 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":846 * * cdef dtype child * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -6887,7 +6936,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_endian_detector = 1; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":848 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":847 * cdef dtype child * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -6896,7 +6945,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":851 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":850 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -6905,21 +6954,21 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ if (unlikely(__pyx_v_descr->names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(1, 851, __pyx_L1_error) + __PYX_ERR(1, 850, __pyx_L1_error) } __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 851, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 850, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 851, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); __pyx_t_3 = 0; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":852 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851 * * for childname in descr.names: * fields = descr.fields[childname] # <<<<<<<<<<<<<< @@ -6928,15 +6977,15 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ if (unlikely(__pyx_v_descr->fields == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 852, __pyx_L1_error) + __PYX_ERR(1, 851, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 852, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 851, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 852, __pyx_L1_error) + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 851, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":853 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":852 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -6949,7 +6998,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(1, 853, __pyx_L1_error) + __PYX_ERR(1, 852, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); @@ -6957,51 +7006,51 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 853, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 852, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 853, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 852, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 853, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 852, __pyx_L1_error) } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 853, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 852, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); __pyx_t_4 = 0; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":855 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":854 * 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 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 855, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 855, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 855, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 854, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); if (unlikely(__pyx_t_6)) { - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":856 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 856, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 855, __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_ERR(1, 856, __pyx_L1_error) + __PYX_ERR(1, 855, __pyx_L1_error) - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":855 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":854 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< @@ -7010,7 +7059,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":858 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":857 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -7030,7 +7079,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L8_next_or:; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":859 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858 * * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -7047,7 +7096,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = __pyx_t_7; __pyx_L7_bool_binop_done:; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":858 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":857 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -7056,20 +7105,20 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ if (unlikely(__pyx_t_6)) { - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":860 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":859 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 860, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 859, __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_ERR(1, 860, __pyx_L1_error) + __PYX_ERR(1, 859, __pyx_L1_error) - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":858 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":857 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -7078,7 +7127,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":870 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":869 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -7086,15 +7135,15 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx * f += 1 */ while (1) { - __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 870, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 869, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 870, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 869, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 870, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 869, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_6) break; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":871 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":870 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -7103,7 +7152,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_f[0]) = 0x78; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":872 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":871 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< @@ -7112,7 +7161,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":873 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":872 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< @@ -7123,7 +7172,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); } - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":875 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":874 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< @@ -7133,7 +7182,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_8 = 0; (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":877 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":876 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -7143,19 +7192,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); if (__pyx_t_6) { - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":878 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":877 * * if not PyDataType_HASFIELDS(child): * t = child.type_num # <<<<<<<<<<<<<< * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") */ - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 878, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); __pyx_t_4 = 0; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":879 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":878 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -7165,20 +7214,20 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); if (unlikely(__pyx_t_6)) { - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":880 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":879 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 880, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 879, __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_ERR(1, 880, __pyx_L1_error) + __PYX_ERR(1, 879, __pyx_L1_error) - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":879 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":878 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -7187,252 +7236,252 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":883 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":882 * * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 883, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 883, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 882, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 883, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 882, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 98; goto __pyx_L15; } - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":884 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":883 * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 884, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 883, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 884, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 883, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 884, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 883, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 66; goto __pyx_L15; } - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":885 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":884 * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 885, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 884, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 885, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 884, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 885, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 884, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x68; goto __pyx_L15; } - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":886 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":885 * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 886, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 885, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 886, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 885, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 886, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 885, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 72; goto __pyx_L15; } - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":887 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":886 * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 887, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 887, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 886, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 887, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 886, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x69; goto __pyx_L15; } - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":888 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":887 * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 888, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 887, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 888, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 887, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 888, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 887, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 73; goto __pyx_L15; } - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":889 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":888 * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 889, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 889, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 888, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 889, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 888, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x6C; goto __pyx_L15; } - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":890 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":889 * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 890, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 889, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 890, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 889, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 890, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 889, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 76; goto __pyx_L15; } - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":891 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":890 * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 891, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 891, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 890, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 891, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 890, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x71; goto __pyx_L15; } - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":892 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":891 * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 892, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 891, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 892, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 891, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 892, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 891, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 81; goto __pyx_L15; } - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":893 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":892 * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 893, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 893, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 892, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 893, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 892, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x66; goto __pyx_L15; } - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":894 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":893 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 894, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 894, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 893, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 894, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 893, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x64; goto __pyx_L15; } - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":895 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":894 * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 895, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 894, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 895, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 894, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 895, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 894, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x67; goto __pyx_L15; } - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":896 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":895 * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 896, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 896, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 895, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 896, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 895, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -7441,18 +7490,18 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":897 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":896 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 897, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 897, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 896, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 897, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 896, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -7461,18 +7510,18 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":898 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":897 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 898, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 897, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 898, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 897, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 898, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 897, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -7481,25 +7530,25 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":899 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":898 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 899, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 899, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 898, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 899, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 898, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(__pyx_t_6)) { (__pyx_v_f[0]) = 79; goto __pyx_L15; } - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":901 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":900 * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< @@ -7507,18 +7556,18 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx * else: */ /*else*/ { - __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 901, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 901, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 900, __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_ERR(1, 901, __pyx_L1_error) + __PYX_ERR(1, 900, __pyx_L1_error) } __pyx_L15:; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":902 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":901 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * f += 1 # <<<<<<<<<<<<<< @@ -7527,7 +7576,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":877 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":876 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -7537,7 +7586,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L13; } - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":906 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":905 * # Cython ignores struct boundary information ("T{...}"), * # so don't output it * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< @@ -7545,12 +7594,12 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx * */ /*else*/ { - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(1, 906, __pyx_L1_error) + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(1, 905, __pyx_L1_error) __pyx_v_f = __pyx_t_9; } __pyx_L13:; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":851 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":850 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -7560,7 +7609,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":907 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":906 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -7570,7 +7619,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_r = __pyx_v_f; goto __pyx_L0; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":842 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":841 * return () * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -7595,7 +7644,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx return __pyx_r; } -/* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1022 +/* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1021 * int _import_umath() except -1 * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -7607,7 +7656,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_array_base", 0); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1023 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1022 * * cdef inline void set_array_base(ndarray arr, object base): * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<< @@ -7616,7 +7665,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_INCREF(__pyx_v_base); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1024 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1023 * cdef inline void set_array_base(ndarray arr, object base): * Py_INCREF(base) # important to do this before stealing the reference below! * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<< @@ -7625,7 +7674,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base)); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1022 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1021 * int _import_umath() except -1 * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -7637,7 +7686,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1026 +/* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1025 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -7652,7 +7701,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 0); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1027 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1026 * * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) # <<<<<<<<<<<<<< @@ -7661,7 +7710,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ __pyx_v_base = PyArray_BASE(__pyx_v_arr); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1028 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1027 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -7671,7 +7720,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = ((__pyx_v_base == NULL) != 0); if (__pyx_t_1) { - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1029 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1028 * base = PyArray_BASE(arr) * if base is NULL: * return None # <<<<<<<<<<<<<< @@ -7682,7 +7731,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1028 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1027 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -7691,7 +7740,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ } - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1030 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1029 * if base is NULL: * return None * return base # <<<<<<<<<<<<<< @@ -7703,7 +7752,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = ((PyObject *)__pyx_v_base); goto __pyx_L0; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1026 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1025 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -7718,7 +7767,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py return __pyx_r; } -/* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1034 +/* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1033 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -7737,9 +7786,12 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_array", 0); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1035 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1034 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -7755,16 +7807,16 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1036 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035 * cdef inline int import_array() except -1: * try: * _import_array() # <<<<<<<<<<<<<< * except Exception: * raise ImportError("numpy.core.multiarray failed to import") */ - __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1036, __pyx_L3_error) + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1035, __pyx_L3_error) - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1035 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1034 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -7778,7 +7830,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1037 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1036 * try: * _import_array() * except Exception: # <<<<<<<<<<<<<< @@ -7788,28 +7840,28 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1037, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1036, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1038 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1037 * _import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< * * cdef inline int import_umath() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1038, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1037, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 1038, __pyx_L5_except_error) + __PYX_ERR(1, 1037, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1035 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1034 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -7824,7 +7876,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_L8_try_end:; } - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1034 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1033 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -7847,7 +7899,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { return __pyx_r; } -/* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1040 +/* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1039 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -7866,9 +7918,12 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_umath", 0); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1041 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1040 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -7884,16 +7939,16 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1042 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041 * cdef inline int import_umath() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< * except Exception: * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1042, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1041, __pyx_L3_error) - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1041 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1040 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -7907,7 +7962,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1043 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1042 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -7917,28 +7972,28 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1043, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1042, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1044 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1043 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< * * cdef inline int import_ufunc() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1044, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1043, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 1044, __pyx_L5_except_error) + __PYX_ERR(1, 1043, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1041 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1040 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -7953,7 +8008,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_L8_try_end:; } - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1040 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1039 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -7976,7 +8031,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { return __pyx_r; } -/* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1046 +/* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1045 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -7995,9 +8050,12 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_ufunc", 0); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1047 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1046 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -8013,16 +8071,16 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1048 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047 * cdef inline int import_ufunc() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< * except Exception: * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1048, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1047, __pyx_L3_error) - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1047 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1046 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -8036,7 +8094,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1049 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1048 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -8045,26 +8103,26 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1049, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1048, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1050 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1049 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1050, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1049, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(1, 1050, __pyx_L5_except_error) + __PYX_ERR(1, 1049, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1047 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1046 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -8079,7 +8137,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_L8_try_end:; } - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1046 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1045 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -8217,6 +8275,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_u_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 1, 0, 0}, {&__pyx_n_s_out, __pyx_k_out, sizeof(__pyx_k_out), 0, 0, 1, 1}, {&__pyx_n_s_policy, __pyx_k_policy, sizeof(__pyx_k_policy), 0, 0, 1, 1}, + {&__pyx_n_s_pre_mine, __pyx_k_pre_mine, sizeof(__pyx_k_pre_mine), 0, 0, 1, 1}, {&__pyx_n_s_predict_wrap, __pyx_k_predict_wrap, sizeof(__pyx_k_predict_wrap), 0, 0, 1, 1}, {&__pyx_n_u_prediction, __pyx_k_prediction, sizeof(__pyx_k_prediction), 0, 1, 0, 1}, {&__pyx_n_s_predictions, __pyx_k_predictions, sizeof(__pyx_k_predictions), 0, 0, 1, 1}, @@ -8244,8 +8303,8 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 125, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 144, __pyx_L1_error) __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_n_s_print); if (!__pyx_builtin_print) __PYX_ERR(0, 356, __pyx_L1_error) - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 856, __pyx_L1_error) - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 1038, __pyx_L1_error) + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 855, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 1037, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -8266,7 +8325,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":272 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< @@ -8277,7 +8336,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":276 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< @@ -8288,7 +8347,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":306 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":306 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -8299,47 +8358,47 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":856 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 856, __pyx_L1_error) + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 855, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":880 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":879 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 880, __pyx_L1_error) + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 879, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1038 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1037 * _import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< * * cdef inline int import_umath() except -1: */ - __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 1038, __pyx_L1_error) + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 1037, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1044 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1043 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< * * cdef inline int import_ufunc() except -1: */ - __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 1044, __pyx_L1_error) + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 1043, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); @@ -8362,10 +8421,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * np.ndarray[np.uint8_t, ndim=2] labels, * features, int max_card, double min_support, verbosity_str, int mine_verbose, */ - __pyx_tuple__13 = PyTuple_Pack(26, __pyx_n_s_samples, __pyx_n_s_labels, __pyx_n_s_features, __pyx_n_s_max_card, __pyx_n_s_min_support, __pyx_n_s_verbosity_str, __pyx_n_s_mine_verbose, __pyx_n_s_minor_verbose, __pyx_n_s_c, __pyx_n_s_policy, __pyx_n_s_map_type, __pyx_n_s_ablation, __pyx_n_s_calculate_size, __pyx_n_s_nfeatures, __pyx_n_s_samples_vecs, __pyx_n_s_nsamples, __pyx_n_s_features_vec, __pyx_n_s_i, __pyx_n_s_bytestr, __pyx_n_s_j, __pyx_n_s_r, __pyx_n_s_verbosity_ascii, __pyx_n_s_verbosity, __pyx_n_s_nsamples_chk, __pyx_n_s_mr, __pyx_n_s_rb); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 179, __pyx_L1_error) + __pyx_tuple__13 = PyTuple_Pack(27, __pyx_n_s_samples, __pyx_n_s_labels, __pyx_n_s_features, __pyx_n_s_max_card, __pyx_n_s_min_support, __pyx_n_s_verbosity_str, __pyx_n_s_mine_verbose, __pyx_n_s_minor_verbose, __pyx_n_s_c, __pyx_n_s_policy, __pyx_n_s_map_type, __pyx_n_s_ablation, __pyx_n_s_calculate_size, __pyx_n_s_pre_mine, __pyx_n_s_nfeatures, __pyx_n_s_samples_vecs, __pyx_n_s_nsamples, __pyx_n_s_features_vec, __pyx_n_s_i, __pyx_n_s_bytestr, __pyx_n_s_j, __pyx_n_s_r, __pyx_n_s_verbosity_ascii, __pyx_n_s_verbosity, __pyx_n_s_nsamples_chk, __pyx_n_s_mr, __pyx_n_s_rb); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); - __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(13, 0, 26, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_corels_pyx, __pyx_n_s_fit_wrap_begin, 179, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 179, __pyx_L1_error) + __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(14, 0, 27, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_corels_pyx, __pyx_n_s_fit_wrap_begin, 179, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 179, __pyx_L1_error) /* "corels/_corels.pyx":339 * return True @@ -8448,6 +8507,9 @@ static int __Pyx_modinit_type_init_code(void) { static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error) @@ -8472,7 +8534,7 @@ static int __Pyx_modinit_type_import_code(void) { __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore); if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 242, __pyx_L1_error) __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Warn); - if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 918, __pyx_L1_error) + if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 917, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; @@ -8499,17 +8561,19 @@ static int __Pyx_modinit_function_import_code(void) { } -#if PY_MAJOR_VERSION < 3 -#ifdef CYTHON_NO_PYINIT_EXPORT -#define __Pyx_PyMODINIT_FUNC void -#else +#ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#elif PY_MAJOR_VERSION < 3 +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" void +#else +#define __Pyx_PyMODINIT_FUNC void #endif #else -#ifdef CYTHON_NO_PYINIT_EXPORT -#define __Pyx_PyMODINIT_FUNC PyObject * +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else -#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif @@ -8591,6 +8655,9 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec__corels(PyObject *__pyx_pyinit_mod #endif { PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { @@ -8679,15 +8746,15 @@ if (!__Pyx_RefNanny) { } #endif /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error; + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error; + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); (void)__Pyx_modinit_type_init_code(); - if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error) (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ @@ -8837,7 +8904,7 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1046 + /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1045 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -8977,7 +9044,7 @@ static int __Pyx_ParseOptionalKeywords( } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 - if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { @@ -9004,7 +9071,7 @@ static int __Pyx_ParseOptionalKeywords( while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; @@ -9020,7 +9087,7 @@ static int __Pyx_ParseOptionalKeywords( while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; @@ -9416,9 +9483,7 @@ static 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; -; + int i = 0, number, ndim; ++ts; if (ctx->new_count != 1) { PyErr_SetString(PyExc_ValueError, @@ -9426,6 +9491,7 @@ __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) return NULL; } if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ndim = ctx->head->field->type->ndim; while (*ts && *ts != ')') { switch (*ts) { case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; @@ -9555,8 +9621,8 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha case 'l': case 'L': case 'q': case 'Q': case 'f': case 'd': case 'g': case 'O': case 'p': - if (ctx->enc_type == *ts && got_Z == ctx->is_complex && - ctx->enc_packmode == ctx->new_packmode) { + if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) && + (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) { ctx->enc_count += ctx->new_count; ctx->new_count = 1; got_Z = 0; @@ -10769,7 +10835,7 @@ static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, { #if PY_MAJOR_VERSION >= 3 if (level == -1) { - if (strchr(__Pyx_MODULE_NAME, '.')) { + if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) { module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); if (!module) { @@ -10806,7 +10872,7 @@ static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK -static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { +static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON @@ -10910,7 +10976,7 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( - __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } diff --git a/corels/_corels.pyx b/corels/_corels.pyx index afebf30..bbdcc50 100644 --- a/corels/_corels.pyx +++ b/corels/_corels.pyx @@ -44,7 +44,7 @@ cdef extern from "src/corels/src/run.hh": cdef extern from "src/utils.hh": int mine_rules(char **features, rule_t *samples, int nfeatures, int nsamples, - int max_card, double min_support, rule_t **rules_out, int verbose) + int max_card, double min_support, rule_t **rules_out, int verbose, int pre_mine) int minority(rule_t* rules, int nrules, rule_t* labels, int nsamples, rule_t* minority_out, int verbose) @@ -180,7 +180,7 @@ def fit_wrap_begin(np.ndarray[np.uint8_t, ndim=2] samples, np.ndarray[np.uint8_t, ndim=2] labels, features, int max_card, double min_support, verbosity_str, int mine_verbose, int minor_verbose, double c, int policy, int map_type, int ablation, - int calculate_size): + int calculate_size, int pre_mine): global rules global labels_vecs global minor @@ -224,7 +224,7 @@ def fit_wrap_begin(np.ndarray[np.uint8_t, ndim=2] samples, n_rules = 0 cdef int r = mine_rules(features_vec, samples_vecs, nfeatures, nsamples, - max_card, min_support, &rules, mine_verbose) + max_card, min_support, &rules, mine_verbose, pre_mine) if features_vec != NULL: for i in range(nfeatures): diff --git a/corels/corels.py b/corels/corels.py index 5e62fb6..eb1dc14 100644 --- a/corels/corels.py +++ b/corels/corels.py @@ -92,7 +92,7 @@ class CorelsClassifier: _estimator_type = "classifier" def __init__(self, c=0.01, n_iter=10000, map_type="prefix", policy="lower_bound", - verbosity=["rulelist"], ablation=0, max_card=2, min_support=0.01): + verbosity=["rulelist"], ablation=0, max_card=2, min_support=0.01, pre_mine=1): self.c = c self.n_iter = n_iter self.map_type = map_type @@ -101,6 +101,7 @@ def __init__(self, c=0.01, n_iter=10000, map_type="prefix", policy="lower_bound" self.ablation = ablation self.max_card = max_card self.min_support = min_support + self.pre_mine = pre_mine def fit(self, X, y, features=[], prediction_name="prediction"): """ @@ -155,6 +156,8 @@ def fit(self, X, y, features=[], prediction_name="prediction"): raise ValueError("Max cardinality must be greater than or equal to 1, got: " + str(self.max_card)) if not isinstance(prediction_name, str): raise TypeError("Prediction name must be a string, got: " + str(type(prediction_name))) + if not isinstance(self.pre_mine, int): + raise TypeError("Pre_mine must be an int, got: " + str(type(self.pre_mine))) label = check_array(y, ndim=1) labels = np.stack([ np.invert(label), label ]) @@ -233,7 +236,7 @@ def fit(self, X, y, features=[], prediction_name="prediction"): fr = fit_wrap_begin(samples.astype(np.uint8, copy=False), labels.astype(np.uint8, copy=False), rl.features, self.max_card, self.min_support, verbose, mine_verbose, minor_verbose, - self.c, policy_id, map_id, self.ablation, False) + self.c, policy_id, map_id, self.ablation, False, self.pre_mine) if fr: early = False diff --git a/corels/src/utils.cpp b/corels/src/utils.cpp index 3c7fd6c..f938cbd 100755 --- a/corels/src/utils.cpp +++ b/corels/src/utils.cpp @@ -153,7 +153,7 @@ int getnextperm(int n, int r, int *arr, int first) } int mine_rules(char **features, rule_t *samples, int nfeatures, int nsamples, - int max_card, double min_support, rule_t **rules_out, int verbose) + int max_card, double min_support, rule_t **rules_out, int verbose, int pre_mine) { if(!samples || !features) { return -1; @@ -162,7 +162,7 @@ int mine_rules(char **features, rule_t *samples, int nfeatures, int nsamples, int *rule_ids = NULL, *rule_names_mine_lengths = NULL; rule_t *rules_vec = NULL, *rules_vec_mine = NULL; - nrules = nfeatures * 2; + (pre_mine) ? nrules = nfeatures * 2 : nrules = nfeatures; rule_alloc = nrules + 1; rules_vec = (rule_t*)malloc(sizeof(rule_t) * rule_alloc); if(!rules_vec) { @@ -194,18 +194,23 @@ int mine_rules(char **features, rule_t *samples, int nfeatures, int nsamples, { for(int j = 0; j < nsamples; j++) { + // if feature is set, set the accoring truth table value + // also set the opposite if pre_mine is selected if(rule_isset(samples[j].truthtable, nfeatures - i - 1, nfeatures)) { rule_set(rules_vec[i + 1].truthtable, nsamples - j - 1, 1, nsamples); - rule_set(rules_vec[nrules / 2 + i + 1].truthtable, nsamples - j - 1, 0, nsamples); + if (pre_mine) + rule_set(rules_vec[nrules / 2 + i + 1].truthtable, nsamples - j - 1, 0, nsamples); } else { rule_set(rules_vec[i + 1].truthtable, nsamples - j - 1, 0, nsamples); - rule_set(rules_vec[nrules / 2 + i + 1].truthtable, nsamples - j - 1, 1, nsamples); + if (pre_mine) + rule_set(rules_vec[nrules / 2 + i + 1].truthtable, nsamples - j - 1, 1, nsamples); } } } // File rules_vec, the mpz_t version of the rules array + // if pre_mine is false we don't want to create the not rules for(int i = 0; i < nrules; i++) { int ones = count_ones_vector(rules_vec[i + 1].truthtable, nsamples); @@ -223,7 +228,7 @@ int mine_rules(char **features, rule_t *samples, int nfeatures, int nsamples, } rule_copy(rules_vec_mine[nrules_mine].truthtable, rules_vec[i + 1].truthtable, nsamples); - if(i < (nrules / 2)) { + if(i < (nrules / 2) || !pre_mine) { rules_vec_mine[nrules_mine].features = strdup(features[i]); rules_vec_mine[nrules_mine].cardinality = i + 1; } @@ -245,7 +250,7 @@ int mine_rules(char **features, rule_t *samples, int nfeatures, int nsamples, rules_vec[ntotal_rules + 1].cardinality = 1; rules_vec[ntotal_rules + 1].support = ones; - if(i < (nrules / 2)) + if(i < (nrules / 2) || !pre_mine) rules_vec[ntotal_rules + 1].features = strdup(features[i]); else { rules_vec[ntotal_rules + 1].features = (char*)malloc(strlen(features[i - (nrules / 2)]) + 5); @@ -269,82 +274,84 @@ int mine_rules(char **features, rule_t *samples, int nfeatures, int nsamples, rule_ids = (int*)malloc(sizeof(int) * max_card); - // Generate higher-cardinality rules - for(int card = 2; card <= max_card; card++) { - // getnextperm works sort of like strtok - int r = getnextperm(nrules_mine, card, rule_ids, 1); - - while(r != -1) { - int valid = 1; - - rule_copy(gen_rule.truthtable, rules_vec_mine[rule_ids[0]].truthtable, nsamples); - int ones = count_ones_vector(gen_rule.truthtable, nsamples); - - // Generate the new rule by successive and operations, and check if it has a valid support - if((double)ones / (double)nsamples >= min_support) { - for(int i = 1; i < card; i++) { - rule_vand(gen_rule.truthtable, rules_vec_mine[rule_ids[i]].truthtable, gen_rule.truthtable, nsamples, &ones); - if((double)ones / (double)nsamples < min_support) { - valid = 0; - break; + // Generate higher-cardinality rules if pre_mine selected + if (pre_mine) { + for(int card = 2; card <= max_card; card++) { + // getnextperm works sort of like strtok + int r = getnextperm(nrules_mine, card, rule_ids, 1); + + while(r != -1) { + int valid = 1; + + rule_copy(gen_rule.truthtable, rules_vec_mine[rule_ids[0]].truthtable, nsamples); + int ones = count_ones_vector(gen_rule.truthtable, nsamples); + + // Generate the new rule by successive and operations, and check if it has a valid support + if((double)ones / (double)nsamples >= min_support) { + for(int i = 1; i < card; i++) { + rule_vand(gen_rule.truthtable, rules_vec_mine[rule_ids[i]].truthtable, gen_rule.truthtable, nsamples, &ones); + if((double)ones / (double)nsamples < min_support) { + valid = 0; + break; + } + } + + if(valid && (double)ones / (double)nsamples > 1.0 - min_support) + valid = 0; } - } + else + valid = 0; - if(valid && (double)ones / (double)nsamples > 1.0 - min_support) - valid = 0; - } - else - valid = 0; + if(valid) { + ntotal_rules++; - if(valid) { - ntotal_rules++; + if(ntotal_rules + 1 > rule_alloc) { + rule_alloc += rule_alloc_block; + rules_vec = (rule_t*)realloc(rules_vec, sizeof(rule_t) * rule_alloc); + } - if(ntotal_rules + 1 > rule_alloc) { - rule_alloc += rule_alloc_block; - rules_vec = (rule_t*)realloc(rules_vec, sizeof(rule_t) * rule_alloc); - } + rule_vinit(nsamples, &rules_vec[ntotal_rules].truthtable); + rule_copy(rules_vec[ntotal_rules].truthtable, gen_rule.truthtable, nsamples); - rule_vinit(nsamples, &rules_vec[ntotal_rules].truthtable); - rule_copy(rules_vec[ntotal_rules].truthtable, gen_rule.truthtable, nsamples); + int name_len = 0; + for(int i = 0; i < card; i++) + name_len += rule_names_mine_lengths[rule_ids[i]] + 1; - int name_len = 0; - for(int i = 0; i < card; i++) - name_len += rule_names_mine_lengths[rule_ids[i]] + 1; - - rules_vec[ntotal_rules].features = (char*)malloc(name_len); + rules_vec[ntotal_rules].features = (char*)malloc(name_len); - int ch_id = 0; - for(int i = 0; i < card; i++) { - for(int j = 0; j < rule_names_mine_lengths[rule_ids[i]]; j++) - rules_vec[ntotal_rules].features[ch_id + j] = rules_vec_mine[rule_ids[i]].features[j]; - - ch_id += rule_names_mine_lengths[rule_ids[i]] + 1; + int ch_id = 0; + for(int i = 0; i < card; i++) { + for(int j = 0; j < rule_names_mine_lengths[rule_ids[i]]; j++) + rules_vec[ntotal_rules].features[ch_id + j] = rules_vec_mine[rule_ids[i]].features[j]; - rules_vec[ntotal_rules].features[ch_id - 1] = ','; - } + ch_id += rule_names_mine_lengths[rule_ids[i]] + 1; - rules_vec[ntotal_rules].features[ch_id - 1] = '\0'; - - rules_vec[ntotal_rules].cardinality = card; - rules_vec[ntotal_rules].ids = (int*)malloc(sizeof(int) * card); - for(int k = 0; k < card; k++) - rules_vec[ntotal_rules].ids[k] = rules_vec_mine[rule_ids[k]].cardinality; - - rules_vec[ntotal_rules].support = ones; - - if(verbose) { - printf("(%d) {", ntotal_rules); - fputs(rules_vec_mine[rule_ids[0]].features, stdout); - for(int i = 1; i < card; i++) { - putchar(','); - fputs(rules_vec_mine[rule_ids[i]].features, stdout); + rules_vec[ntotal_rules].features[ch_id - 1] = ','; + } + + rules_vec[ntotal_rules].features[ch_id - 1] = '\0'; + + rules_vec[ntotal_rules].cardinality = card; + rules_vec[ntotal_rules].ids = (int*)malloc(sizeof(int) * card); + for(int k = 0; k < card; k++) + rules_vec[ntotal_rules].ids[k] = rules_vec_mine[rule_ids[k]].cardinality; + + rules_vec[ntotal_rules].support = ones; + + if(verbose) { + printf("(%d) {", ntotal_rules); + fputs(rules_vec_mine[rule_ids[0]].features, stdout); + for(int i = 1; i < card; i++) { + putchar(','); + fputs(rules_vec_mine[rule_ids[i]].features, stdout); + } + printf("} generated with support %f\n", (double)ones / (double)nsamples); + } } - printf("} generated with support %f\n", (double)ones / (double)nsamples); + + r = getnextperm(nrules_mine, card, rule_ids, 0); } } - - r = getnextperm(nrules_mine, card, rule_ids, 0); - } } rules_vec[0].cardinality = 1; diff --git a/corels/src/utils.hh b/corels/src/utils.hh index 2a15097..5cb60f9 100644 --- a/corels/src/utils.hh +++ b/corels/src/utils.hh @@ -4,7 +4,7 @@ #include "rule.hh" int mine_rules(char** features, rule_t *samples, int nfeatures, int nsamples, - int max_card, double min_support, rule_t **rules_out, int verbose); + int max_card, double min_support, rule_t **rules_out, int verbose, int pre_mine); int minority(rule_t* rules, int nrules, rule_t* labels, int nsamples, rule_t* minority_out, int verbose); From 808a1eb004828feb58a3c7f04251444cb1234e83 Mon Sep 17 00:00:00 2001 From: alexander Date: Mon, 22 Jun 2020 10:30:29 -0700 Subject: [PATCH 2/5] added parallel corels support --- corels/.gitignore | 1 + corels/_corels.cpp | 1848 ++++++++++++++++-------------------------- corels/_corels.pyx | 140 ++-- corels/corels.py | 35 +- corels/src/corels | 2 +- corels/src/utils.cpp | 8 +- corels/src/utils.hh | 4 +- setup.py | 6 +- 8 files changed, 815 insertions(+), 1229 deletions(-) diff --git a/corels/.gitignore b/corels/.gitignore index e69de29..723ef36 100644 --- a/corels/.gitignore +++ b/corels/.gitignore @@ -0,0 +1 @@ +.idea \ No newline at end of file diff --git a/corels/_corels.cpp b/corels/_corels.cpp index 5d1902f..a172554 100644 --- a/corels/_corels.cpp +++ b/corels/_corels.cpp @@ -632,7 +632,7 @@ static CYTHON_INLINE float __PYX_NAN() { #include #include "numpy/arrayobject.h" #include "numpy/ufuncobject.h" -#include "src/corels/src/rule.hh" +#include "src/corels/src/rule.h" #include "src/corels/src/run.hh" #include "src/utils.hh" #include "src/corels/src/pmap.hh" @@ -1785,7 +1785,6 @@ static PermutationMap *__pyx_v_6corels_7_corels_pmap; static CacheTree *__pyx_v_6corels_7_corels_tree; static Queue *__pyx_v_6corels_7_corels_queue; static double __pyx_v_6corels_7_corels_init; -static std::set __pyx_v_6corels_7_corels_run_verbosity; static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *, int *); /*proto*/ static PyObject *__pyx_f_6corels_7_corels__free_vector(rule_t *, int); /*proto*/ static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t = { "uint8_t", NULL, sizeof(__pyx_t_5numpy_uint8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint8_t), 0 }; @@ -1797,7 +1796,6 @@ int __pyx_module_is_main_corels___corels = 0; static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_MemoryError; static PyObject *__pyx_builtin_ValueError; -static PyObject *__pyx_builtin_print; static PyObject *__pyx_builtin_RuntimeError; static PyObject *__pyx_builtin_ImportError; static const char __pyx_k_[] = ""; @@ -1822,9 +1820,7 @@ static const char __pyx_k_nidx[] = "nidx"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_ascii[] = "ascii"; static const char __pyx_k_dtype[] = "dtype"; -static const char __pyx_k_early[] = "early"; static const char __pyx_k_numpy[] = "numpy"; -static const char __pyx_k_print[] = "print"; static const char __pyx_k_r_out[] = "r_out"; static const char __pyx_k_range[] = "range"; static const char __pyx_k_rules[] = "rules"; @@ -1847,7 +1843,6 @@ static const char __pyx_k_max_card[] = "max_card"; static const char __pyx_k_nsamples[] = "nsamples"; static const char __pyx_k_pre_mine[] = "pre_mine"; static const char __pyx_k_rulelist[] = "rulelist"; -static const char __pyx_k_max_nodes[] = "max_nodes"; static const char __pyx_k_next_rule[] = "next_rule"; static const char __pyx_k_nfeatures[] = "nfeatures"; static const char __pyx_k_verbosity[] = "verbosity"; @@ -1858,16 +1853,16 @@ static const char __pyx_k_ImportError[] = "ImportError"; static const char __pyx_k_MemoryError[] = "MemoryError"; static const char __pyx_k_antecedents[] = "antecedents"; static const char __pyx_k_min_support[] = "min_support"; +static const char __pyx_k_minor_count[] = "minor_count"; +static const char __pyx_k_num_threads[] = "num_threads"; static const char __pyx_k_predictions[] = "predictions"; static const char __pyx_k_RuntimeError[] = "RuntimeError"; static const char __pyx_k_features_vec[] = "features_vec"; -static const char __pyx_k_fit_wrap_end[] = "fit_wrap_end"; static const char __pyx_k_mine_verbose[] = "mine_verbose"; static const char __pyx_k_nsamples_chk[] = "nsamples_chk"; static const char __pyx_k_predict_wrap[] = "predict_wrap"; static const char __pyx_k_samples_vecs[] = "samples_vecs"; static const char __pyx_k_and_rule_data[] = ") and rule data ("; -static const char __pyx_k_fit_wrap_loop[] = "fit_wrap_loop"; static const char __pyx_k_max_num_nodes[] = "max_num_nodes"; static const char __pyx_k_minor_verbose[] = "minor_verbose"; static const char __pyx_k_verbosity_str[] = "verbosity_str"; @@ -1922,13 +1917,10 @@ static PyObject *__pyx_n_s_corels__corels; static PyObject *__pyx_kp_s_corels_pyx; static PyObject *__pyx_n_s_default; static PyObject *__pyx_n_s_dtype; -static PyObject *__pyx_n_s_early; static PyObject *__pyx_n_s_encode; static PyObject *__pyx_n_s_features; static PyObject *__pyx_n_s_features_vec; static PyObject *__pyx_n_s_fit_wrap_begin; -static PyObject *__pyx_n_s_fit_wrap_end; -static PyObject *__pyx_n_s_fit_wrap_loop; static PyObject *__pyx_n_s_i; static PyObject *__pyx_n_s_idx; static PyObject *__pyx_n_s_import; @@ -1937,10 +1929,10 @@ static PyObject *__pyx_n_s_labels; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_map_type; static PyObject *__pyx_n_s_max_card; -static PyObject *__pyx_n_s_max_nodes; static PyObject *__pyx_n_s_max_num_nodes; static PyObject *__pyx_n_s_min_support; static PyObject *__pyx_n_s_mine_verbose; +static PyObject *__pyx_n_s_minor_count; static PyObject *__pyx_n_s_minor_verbose; static PyObject *__pyx_n_s_mr; static PyObject *__pyx_n_s_n_rules; @@ -1953,6 +1945,7 @@ static PyObject *__pyx_n_s_nidx; static PyObject *__pyx_n_s_np; static PyObject *__pyx_n_s_nsamples; static PyObject *__pyx_n_s_nsamples_chk; +static PyObject *__pyx_n_s_num_threads; static PyObject *__pyx_n_s_numpy; static PyObject *__pyx_kp_u_numpy_core_multiarray_failed_to; static PyObject *__pyx_kp_u_numpy_core_umath_failed_to_impor; @@ -1962,7 +1955,6 @@ static PyObject *__pyx_n_s_pre_mine; static PyObject *__pyx_n_s_predict_wrap; static PyObject *__pyx_n_u_prediction; static PyObject *__pyx_n_s_predictions; -static PyObject *__pyx_n_s_print; static PyObject *__pyx_n_s_r; static PyObject *__pyx_n_s_r_out; static PyObject *__pyx_n_s_range; @@ -1980,9 +1972,7 @@ static PyObject *__pyx_n_s_verbosity_ascii; static PyObject *__pyx_n_s_verbosity_str; static PyObject *__pyx_n_s_zeros; static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_X, PyObject *__pyx_v_rules); /* proto */ -static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_samples, PyArrayObject *__pyx_v_labels, PyObject *__pyx_v_features, int __pyx_v_max_card, double __pyx_v_min_support, PyObject *__pyx_v_verbosity_str, int __pyx_v_mine_verbose, int __pyx_v_minor_verbose, double __pyx_v_c, int __pyx_v_policy, int __pyx_v_map_type, int __pyx_v_ablation, int __pyx_v_calculate_size, int __pyx_v_pre_mine); /* proto */ -static PyObject *__pyx_pf_6corels_7_corels_4fit_wrap_loop(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_max_nodes); /* proto */ -static PyObject *__pyx_pf_6corels_7_corels_6fit_wrap_end(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_early); /* proto */ +static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_samples, PyArrayObject *__pyx_v_labels, PyObject *__pyx_v_features, int __pyx_v_max_card, double __pyx_v_min_support, PyObject *__pyx_v_verbosity_str, int __pyx_v_mine_verbose, int __pyx_v_minor_verbose, double __pyx_v_c, int __pyx_v_policy, int __pyx_v_map_type, int __pyx_v_ablation, int __pyx_v_calculate_size, int __pyx_v_pre_mine, int __pyx_v_num_threads, int __pyx_v_max_num_nodes); /* proto */ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ static PyObject *__pyx_int_0; @@ -1996,15 +1986,11 @@ static PyObject *__pyx_tuple__9; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__13; -static PyObject *__pyx_tuple__15; -static PyObject *__pyx_tuple__17; static PyObject *__pyx_codeobj__12; static PyObject *__pyx_codeobj__14; -static PyObject *__pyx_codeobj__16; -static PyObject *__pyx_codeobj__18; /* Late includes */ -/* "corels/_corels.pyx":65 +/* "corels/_corels.pyx":60 * @cython.boundscheck(False) * @cython.wraparound(False) * def predict_wrap(np.ndarray[np.uint8_t, ndim=2] X, rules): # <<<<<<<<<<<<<< @@ -2047,11 +2033,11 @@ static PyObject *__pyx_pw_6corels_7_corels_1predict_wrap(PyObject *__pyx_self, P case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rules)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("predict_wrap", 1, 2, 2, 1); __PYX_ERR(0, 65, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("predict_wrap", 1, 2, 2, 1); __PYX_ERR(0, 60, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "predict_wrap") < 0)) __PYX_ERR(0, 65, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "predict_wrap") < 0)) __PYX_ERR(0, 60, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -2064,13 +2050,13 @@ static PyObject *__pyx_pw_6corels_7_corels_1predict_wrap(PyObject *__pyx_self, P } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("predict_wrap", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 65, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("predict_wrap", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 60, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("corels._corels.predict_wrap", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_ptype_5numpy_ndarray, 1, "X", 0))) __PYX_ERR(0, 65, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_ptype_5numpy_ndarray, 1, "X", 0))) __PYX_ERR(0, 60, __pyx_L1_error) __pyx_r = __pyx_pf_6corels_7_corels_predict_wrap(__pyx_self, __pyx_v_X, __pyx_v_rules); /* function exit code */ @@ -2131,11 +2117,11 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * __pyx_pybuffernd_X.rcbuffer = &__pyx_pybuffer_X; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_X.rcbuffer->pybuffer, (PyObject*)__pyx_v_X, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 65, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_X.rcbuffer->pybuffer, (PyObject*)__pyx_v_X, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 60, __pyx_L1_error) } __pyx_pybuffernd_X.diminfo[0].strides = __pyx_pybuffernd_X.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_X.diminfo[0].shape = __pyx_pybuffernd_X.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_X.diminfo[1].strides = __pyx_pybuffernd_X.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_X.diminfo[1].shape = __pyx_pybuffernd_X.rcbuffer->pybuffer.shape[1]; - /* "corels/_corels.pyx":66 + /* "corels/_corels.pyx":61 * @cython.wraparound(False) * def predict_wrap(np.ndarray[np.uint8_t, ndim=2] X, rules): * cdef int nsamples = X.shape[0] # <<<<<<<<<<<<<< @@ -2144,7 +2130,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * */ __pyx_v_nsamples = (__pyx_v_X->dimensions[0]); - /* "corels/_corels.pyx":67 + /* "corels/_corels.pyx":62 * def predict_wrap(np.ndarray[np.uint8_t, ndim=2] X, rules): * cdef int nsamples = X.shape[0] * cdef int nfeatures = X.shape[1] # <<<<<<<<<<<<<< @@ -2153,54 +2139,54 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * */ __pyx_v_nfeatures = (__pyx_v_X->dimensions[1]); - /* "corels/_corels.pyx":69 + /* "corels/_corels.pyx":64 * cdef int nfeatures = X.shape[1] * * cdef np.ndarray out = np.zeros(nsamples, dtype=np.uint8) # <<<<<<<<<<<<<< * cdef int n_rules = len(rules) - 1 * if n_rules < 0: */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nsamples); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nsamples); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 69, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 69, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 69, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 69, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 69, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 64, __pyx_L1_error) __pyx_v_out = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "corels/_corels.pyx":70 + /* "corels/_corels.pyx":65 * * cdef np.ndarray out = np.zeros(nsamples, dtype=np.uint8) * cdef int n_rules = len(rules) - 1 # <<<<<<<<<<<<<< * if n_rules < 0: * return out */ - __pyx_t_6 = PyObject_Length(__pyx_v_rules); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 70, __pyx_L1_error) + __pyx_t_6 = PyObject_Length(__pyx_v_rules); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 65, __pyx_L1_error) __pyx_v_n_rules = (__pyx_t_6 - 1); - /* "corels/_corels.pyx":71 + /* "corels/_corels.pyx":66 * cdef np.ndarray out = np.zeros(nsamples, dtype=np.uint8) * cdef int n_rules = len(rules) - 1 * if n_rules < 0: # <<<<<<<<<<<<<< @@ -2210,7 +2196,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * __pyx_t_7 = ((__pyx_v_n_rules < 0) != 0); if (__pyx_t_7) { - /* "corels/_corels.pyx":72 + /* "corels/_corels.pyx":67 * cdef int n_rules = len(rules) - 1 * if n_rules < 0: * return out # <<<<<<<<<<<<<< @@ -2222,7 +2208,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * __pyx_r = ((PyObject *)__pyx_v_out); goto __pyx_L0; - /* "corels/_corels.pyx":71 + /* "corels/_corels.pyx":66 * cdef np.ndarray out = np.zeros(nsamples, dtype=np.uint8) * cdef int n_rules = len(rules) - 1 * if n_rules < 0: # <<<<<<<<<<<<<< @@ -2231,23 +2217,23 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * */ } - /* "corels/_corels.pyx":75 + /* "corels/_corels.pyx":70 * * cdef int s, r, next_rule, nidx, a, idx, c * cdef int default = bool(rules[n_rules]["prediction"]) # <<<<<<<<<<<<<< * * cdef int* antecedent_lengths = malloc(sizeof(int) * n_rules) */ - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_rules, __pyx_v_n_rules, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 75, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_rules, __pyx_v_n_rules, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_u_prediction); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_u_prediction); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 75, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_default = (!(!__pyx_t_7)); - /* "corels/_corels.pyx":77 + /* "corels/_corels.pyx":72 * cdef int default = bool(rules[n_rules]["prediction"]) * * cdef int* antecedent_lengths = malloc(sizeof(int) * n_rules) # <<<<<<<<<<<<<< @@ -2256,7 +2242,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * */ __pyx_v_antecedent_lengths = ((int *)malloc(((sizeof(int)) * __pyx_v_n_rules))); - /* "corels/_corels.pyx":78 + /* "corels/_corels.pyx":73 * * cdef int* antecedent_lengths = malloc(sizeof(int) * n_rules) * cdef int* predictions = malloc(sizeof(int) * n_rules) # <<<<<<<<<<<<<< @@ -2265,7 +2251,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * */ __pyx_v_predictions = ((int *)malloc(((sizeof(int)) * __pyx_v_n_rules))); - /* "corels/_corels.pyx":79 + /* "corels/_corels.pyx":74 * cdef int* antecedent_lengths = malloc(sizeof(int) * n_rules) * cdef int* predictions = malloc(sizeof(int) * n_rules) * cdef int** antecedents = malloc(sizeof(int*) * n_rules) # <<<<<<<<<<<<<< @@ -2274,7 +2260,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * */ __pyx_v_antecedents = ((int **)malloc(((sizeof(int *)) * __pyx_v_n_rules))); - /* "corels/_corels.pyx":81 + /* "corels/_corels.pyx":76 * cdef int** antecedents = malloc(sizeof(int*) * n_rules) * * for r in range(n_rules): # <<<<<<<<<<<<<< @@ -2286,42 +2272,42 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_r = __pyx_t_10; - /* "corels/_corels.pyx":82 + /* "corels/_corels.pyx":77 * * for r in range(n_rules): * antecedent_lengths[r] = len(rules[r]["antecedents"]) # <<<<<<<<<<<<<< * predictions[r] = int(rules[r]["prediction"]) * antecedents[r] = malloc(sizeof(int) * antecedent_lengths[r]) */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_rules, __pyx_v_r, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_rules, __pyx_v_r, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_antecedents); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 82, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_antecedents); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 82, __pyx_L1_error) + __pyx_t_6 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; (__pyx_v_antecedent_lengths[__pyx_v_r]) = __pyx_t_6; - /* "corels/_corels.pyx":83 + /* "corels/_corels.pyx":78 * for r in range(n_rules): * antecedent_lengths[r] = len(rules[r]["antecedents"]) * predictions[r] = int(rules[r]["prediction"]) # <<<<<<<<<<<<<< * antecedents[r] = malloc(sizeof(int) * antecedent_lengths[r]) * for a in range(antecedent_lengths[r]): */ - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_rules, __pyx_v_r, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 83, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_rules, __pyx_v_r, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_u_prediction); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_u_prediction); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 83, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 83, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; (__pyx_v_predictions[__pyx_v_r]) = __pyx_t_11; - /* "corels/_corels.pyx":84 + /* "corels/_corels.pyx":79 * antecedent_lengths[r] = len(rules[r]["antecedents"]) * predictions[r] = int(rules[r]["prediction"]) * antecedents[r] = malloc(sizeof(int) * antecedent_lengths[r]) # <<<<<<<<<<<<<< @@ -2330,7 +2316,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * */ (__pyx_v_antecedents[__pyx_v_r]) = ((int *)malloc(((sizeof(int)) * (__pyx_v_antecedent_lengths[__pyx_v_r])))); - /* "corels/_corels.pyx":85 + /* "corels/_corels.pyx":80 * predictions[r] = int(rules[r]["prediction"]) * antecedents[r] = malloc(sizeof(int) * antecedent_lengths[r]) * for a in range(antecedent_lengths[r]): # <<<<<<<<<<<<<< @@ -2342,28 +2328,28 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { __pyx_v_a = __pyx_t_13; - /* "corels/_corels.pyx":86 + /* "corels/_corels.pyx":81 * antecedents[r] = malloc(sizeof(int) * antecedent_lengths[r]) * for a in range(antecedent_lengths[r]): * antecedents[r][a] = rules[r]["antecedents"][a] # <<<<<<<<<<<<<< * * # This compiles to C, so it's pretty fast! */ - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_rules, __pyx_v_r, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 86, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_rules, __pyx_v_r, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_u_antecedents); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_u_antecedents); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_a, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 86, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_a, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; ((__pyx_v_antecedents[__pyx_v_r])[__pyx_v_a]) = __pyx_t_14; } } - /* "corels/_corels.pyx":89 + /* "corels/_corels.pyx":84 * * # This compiles to C, so it's pretty fast! * for s in range(nsamples): # <<<<<<<<<<<<<< @@ -2375,7 +2361,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_s = __pyx_t_10; - /* "corels/_corels.pyx":90 + /* "corels/_corels.pyx":85 * # This compiles to C, so it's pretty fast! * for s in range(nsamples): * for r in range(n_rules): # <<<<<<<<<<<<<< @@ -2387,7 +2373,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { __pyx_v_r = __pyx_t_13; - /* "corels/_corels.pyx":91 + /* "corels/_corels.pyx":86 * for s in range(nsamples): * for r in range(n_rules): * next_rule = 0 # <<<<<<<<<<<<<< @@ -2396,7 +2382,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * */ __pyx_v_next_rule = 0; - /* "corels/_corels.pyx":92 + /* "corels/_corels.pyx":87 * for r in range(n_rules): * next_rule = 0 * nidx = antecedent_lengths[r] # <<<<<<<<<<<<<< @@ -2405,7 +2391,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * */ __pyx_v_nidx = (__pyx_v_antecedent_lengths[__pyx_v_r]); - /* "corels/_corels.pyx":93 + /* "corels/_corels.pyx":88 * next_rule = 0 * nidx = antecedent_lengths[r] * for a in range(nidx): # <<<<<<<<<<<<<< @@ -2417,7 +2403,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_a = __pyx_t_16; - /* "corels/_corels.pyx":94 + /* "corels/_corels.pyx":89 * nidx = antecedent_lengths[r] * for a in range(nidx): * idx = antecedents[r][a] # <<<<<<<<<<<<<< @@ -2426,7 +2412,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * */ __pyx_v_idx = ((__pyx_v_antecedents[__pyx_v_r])[__pyx_v_a]); - /* "corels/_corels.pyx":95 + /* "corels/_corels.pyx":90 * for a in range(nidx): * idx = antecedents[r][a] * c = 1 # <<<<<<<<<<<<<< @@ -2435,7 +2421,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * */ __pyx_v_c = 1; - /* "corels/_corels.pyx":96 + /* "corels/_corels.pyx":91 * idx = antecedents[r][a] * c = 1 * if idx < 0: # <<<<<<<<<<<<<< @@ -2445,7 +2431,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * __pyx_t_7 = ((__pyx_v_idx < 0) != 0); if (__pyx_t_7) { - /* "corels/_corels.pyx":97 + /* "corels/_corels.pyx":92 * c = 1 * if idx < 0: * idx = -idx # <<<<<<<<<<<<<< @@ -2454,7 +2440,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * */ __pyx_v_idx = (-__pyx_v_idx); - /* "corels/_corels.pyx":98 + /* "corels/_corels.pyx":93 * if idx < 0: * idx = -idx * c = 0 # <<<<<<<<<<<<<< @@ -2463,7 +2449,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * */ __pyx_v_c = 0; - /* "corels/_corels.pyx":96 + /* "corels/_corels.pyx":91 * idx = antecedents[r][a] * c = 1 * if idx < 0: # <<<<<<<<<<<<<< @@ -2472,7 +2458,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * */ } - /* "corels/_corels.pyx":100 + /* "corels/_corels.pyx":95 * c = 0 * * idx = idx - 1 # <<<<<<<<<<<<<< @@ -2481,7 +2467,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * */ __pyx_v_idx = (__pyx_v_idx - 1); - /* "corels/_corels.pyx":101 + /* "corels/_corels.pyx":96 * * idx = idx - 1 * if idx >= nfeatures or X[s, idx] != c: # <<<<<<<<<<<<<< @@ -2501,7 +2487,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * __pyx_L16_bool_binop_done:; if (__pyx_t_7) { - /* "corels/_corels.pyx":102 + /* "corels/_corels.pyx":97 * idx = idx - 1 * if idx >= nfeatures or X[s, idx] != c: * next_rule = 1 # <<<<<<<<<<<<<< @@ -2510,7 +2496,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * */ __pyx_v_next_rule = 1; - /* "corels/_corels.pyx":103 + /* "corels/_corels.pyx":98 * if idx >= nfeatures or X[s, idx] != c: * next_rule = 1 * break # <<<<<<<<<<<<<< @@ -2519,7 +2505,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * */ goto __pyx_L13_break; - /* "corels/_corels.pyx":101 + /* "corels/_corels.pyx":96 * * idx = idx - 1 * if idx >= nfeatures or X[s, idx] != c: # <<<<<<<<<<<<<< @@ -2530,7 +2516,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * } __pyx_L13_break:; - /* "corels/_corels.pyx":105 + /* "corels/_corels.pyx":100 * break * * if next_rule == 0: # <<<<<<<<<<<<<< @@ -2540,19 +2526,19 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * __pyx_t_7 = ((__pyx_v_next_rule == 0) != 0); if (__pyx_t_7) { - /* "corels/_corels.pyx":106 + /* "corels/_corels.pyx":101 * * if next_rule == 0: * out[s] = predictions[r]; # <<<<<<<<<<<<<< * break * */ - __pyx_t_5 = __Pyx_PyInt_From_int((__pyx_v_predictions[__pyx_v_r])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int((__pyx_v_predictions[__pyx_v_r])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_out), __pyx_v_s, __pyx_t_5, int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0)) __PYX_ERR(0, 106, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_out), __pyx_v_s, __pyx_t_5, int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "corels/_corels.pyx":107 + /* "corels/_corels.pyx":102 * if next_rule == 0: * out[s] = predictions[r]; * break # <<<<<<<<<<<<<< @@ -2561,7 +2547,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * */ goto __pyx_L11_break; - /* "corels/_corels.pyx":105 + /* "corels/_corels.pyx":100 * break * * if next_rule == 0: # <<<<<<<<<<<<<< @@ -2572,7 +2558,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * } __pyx_L11_break:; - /* "corels/_corels.pyx":109 + /* "corels/_corels.pyx":104 * break * * if next_rule == 1: # <<<<<<<<<<<<<< @@ -2582,19 +2568,19 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * __pyx_t_7 = ((__pyx_v_next_rule == 1) != 0); if (__pyx_t_7) { - /* "corels/_corels.pyx":110 + /* "corels/_corels.pyx":105 * * if next_rule == 1: * out[s] = default # <<<<<<<<<<<<<< * * for r in range(n_rules): */ - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_default); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 110, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_default); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_out), __pyx_v_s, __pyx_t_5, int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0)) __PYX_ERR(0, 110, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_out), __pyx_v_s, __pyx_t_5, int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "corels/_corels.pyx":109 + /* "corels/_corels.pyx":104 * break * * if next_rule == 1: # <<<<<<<<<<<<<< @@ -2604,7 +2590,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * } } - /* "corels/_corels.pyx":112 + /* "corels/_corels.pyx":107 * out[s] = default * * for r in range(n_rules): # <<<<<<<<<<<<<< @@ -2616,7 +2602,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_r = __pyx_t_10; - /* "corels/_corels.pyx":113 + /* "corels/_corels.pyx":108 * * for r in range(n_rules): * free(antecedents[r]) # <<<<<<<<<<<<<< @@ -2626,7 +2612,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * free((__pyx_v_antecedents[__pyx_v_r])); } - /* "corels/_corels.pyx":114 + /* "corels/_corels.pyx":109 * for r in range(n_rules): * free(antecedents[r]) * free(antecedents) # <<<<<<<<<<<<<< @@ -2635,7 +2621,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * */ free(__pyx_v_antecedents); - /* "corels/_corels.pyx":115 + /* "corels/_corels.pyx":110 * free(antecedents[r]) * free(antecedents) * free(predictions) # <<<<<<<<<<<<<< @@ -2644,7 +2630,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * */ free(__pyx_v_predictions); - /* "corels/_corels.pyx":116 + /* "corels/_corels.pyx":111 * free(antecedents) * free(predictions) * free(antecedent_lengths) # <<<<<<<<<<<<<< @@ -2653,7 +2639,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * */ free(__pyx_v_antecedent_lengths); - /* "corels/_corels.pyx":118 + /* "corels/_corels.pyx":113 * free(antecedent_lengths) * * return out # <<<<<<<<<<<<<< @@ -2665,7 +2651,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * __pyx_r = ((PyObject *)__pyx_v_out); goto __pyx_L0; - /* "corels/_corels.pyx":65 + /* "corels/_corels.pyx":60 * @cython.boundscheck(False) * @cython.wraparound(False) * def predict_wrap(np.ndarray[np.uint8_t, ndim=2] X, rules): # <<<<<<<<<<<<<< @@ -2698,7 +2684,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * return __pyx_r; } -/* "corels/_corels.pyx":120 +/* "corels/_corels.pyx":115 * return out * * cdef rule_t* _to_vector(np.ndarray[np.uint8_t, ndim=2] X, int* ncount_out): # <<<<<<<<<<<<<< @@ -2742,23 +2728,23 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int __pyx_pybuffernd_X.rcbuffer = &__pyx_pybuffer_X; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_X.rcbuffer->pybuffer, (PyObject*)__pyx_v_X, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 120, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_X.rcbuffer->pybuffer, (PyObject*)__pyx_v_X, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 115, __pyx_L1_error) } __pyx_pybuffernd_X.diminfo[0].strides = __pyx_pybuffernd_X.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_X.diminfo[0].shape = __pyx_pybuffernd_X.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_X.diminfo[1].strides = __pyx_pybuffernd_X.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_X.diminfo[1].shape = __pyx_pybuffernd_X.rcbuffer->pybuffer.shape[1]; - /* "corels/_corels.pyx":121 + /* "corels/_corels.pyx":116 * * cdef rule_t* _to_vector(np.ndarray[np.uint8_t, ndim=2] X, int* ncount_out): * d0 = X.shape[0] # <<<<<<<<<<<<<< * d1 = X.shape[1] * cdef rule_t* vectors = malloc(d0 * sizeof(rule_t)) */ - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_X->dimensions[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_X->dimensions[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_d0 = __pyx_t_1; __pyx_t_1 = 0; - /* "corels/_corels.pyx":122 + /* "corels/_corels.pyx":117 * cdef rule_t* _to_vector(np.ndarray[np.uint8_t, ndim=2] X, int* ncount_out): * d0 = X.shape[0] * d1 = X.shape[1] # <<<<<<<<<<<<<< @@ -2767,23 +2753,23 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int */ __pyx_v_d1 = (__pyx_v_X->dimensions[1]); - /* "corels/_corels.pyx":123 + /* "corels/_corels.pyx":118 * d0 = X.shape[0] * d1 = X.shape[1] * cdef rule_t* vectors = malloc(d0 * sizeof(rule_t)) # <<<<<<<<<<<<<< * if vectors == NULL: * raise MemoryError() */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t((sizeof(rule_t))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t((sizeof(rule_t))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Multiply(__pyx_v_d0, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error) + __pyx_t_2 = PyNumber_Multiply(__pyx_v_d0, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 123, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_vectors = ((rule_t *)malloc(__pyx_t_3)); - /* "corels/_corels.pyx":124 + /* "corels/_corels.pyx":119 * d1 = X.shape[1] * cdef rule_t* vectors = malloc(d0 * sizeof(rule_t)) * if vectors == NULL: # <<<<<<<<<<<<<< @@ -2793,16 +2779,16 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int __pyx_t_4 = ((__pyx_v_vectors == NULL) != 0); if (unlikely(__pyx_t_4)) { - /* "corels/_corels.pyx":125 + /* "corels/_corels.pyx":120 * cdef rule_t* vectors = malloc(d0 * sizeof(rule_t)) * if vectors == NULL: * raise MemoryError() # <<<<<<<<<<<<<< * * cdef int nones, ncount; */ - PyErr_NoMemory(); __PYX_ERR(0, 125, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(0, 120, __pyx_L1_error) - /* "corels/_corels.pyx":124 + /* "corels/_corels.pyx":119 * d1 = X.shape[1] * cdef rule_t* vectors = malloc(d0 * sizeof(rule_t)) * if vectors == NULL: # <<<<<<<<<<<<<< @@ -2811,22 +2797,22 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int */ } - /* "corels/_corels.pyx":129 + /* "corels/_corels.pyx":124 * cdef int nones, ncount; * * for i in range(d0): # <<<<<<<<<<<<<< * arrstr = "" * for j in range(d1): */ - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_d0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_d0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 129, __pyx_L1_error) + __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 124, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -2834,17 +2820,17 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 129, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 124, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 129, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 124, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -2854,7 +2840,7 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 129, __pyx_L1_error) + else __PYX_ERR(0, 124, __pyx_L1_error) } break; } @@ -2863,7 +2849,7 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; - /* "corels/_corels.pyx":130 + /* "corels/_corels.pyx":125 * * for i in range(d0): * arrstr = "" # <<<<<<<<<<<<<< @@ -2873,25 +2859,25 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int __Pyx_INCREF(__pyx_kp_u_); __Pyx_XDECREF_SET(__pyx_v_arrstr, __pyx_kp_u_); - /* "corels/_corels.pyx":131 + /* "corels/_corels.pyx":126 * for i in range(d0): * arrstr = "" * for j in range(d1): # <<<<<<<<<<<<<< * if X[i][j]: * arrstr += "1" */ - __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_d1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_d1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 131, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) { __pyx_t_2 = __pyx_t_7; __Pyx_INCREF(__pyx_t_2); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 131, __pyx_L1_error) + __pyx_t_9 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 126, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; for (;;) { @@ -2899,17 +2885,17 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 131, __pyx_L1_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 126, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 131, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 131, __pyx_L1_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 126, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 131, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -2919,7 +2905,7 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 131, __pyx_L1_error) + else __PYX_ERR(0, 126, __pyx_L1_error) } break; } @@ -2928,35 +2914,35 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_7); __pyx_t_7 = 0; - /* "corels/_corels.pyx":132 + /* "corels/_corels.pyx":127 * arrstr = "" * for j in range(d1): * if X[i][j]: # <<<<<<<<<<<<<< * arrstr += "1" * else: */ - __pyx_t_7 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_X), __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 132, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_X), __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_v_j); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 132, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_v_j); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 132, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_4) { - /* "corels/_corels.pyx":133 + /* "corels/_corels.pyx":128 * for j in range(d1): * if X[i][j]: * arrstr += "1" # <<<<<<<<<<<<<< * else: * arrstr += "0" */ - __pyx_t_10 = __Pyx_PyUnicode_Concat(__pyx_v_arrstr, __pyx_kp_u_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 133, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyUnicode_Concat(__pyx_v_arrstr, __pyx_kp_u_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF_SET(__pyx_v_arrstr, ((PyObject*)__pyx_t_10)); __pyx_t_10 = 0; - /* "corels/_corels.pyx":132 + /* "corels/_corels.pyx":127 * arrstr = "" * for j in range(d1): * if X[i][j]: # <<<<<<<<<<<<<< @@ -2966,7 +2952,7 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int goto __pyx_L8; } - /* "corels/_corels.pyx":135 + /* "corels/_corels.pyx":130 * arrstr += "1" * else: * arrstr += "0" # <<<<<<<<<<<<<< @@ -2974,14 +2960,14 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int * bytestr = arrstr.encode("ascii") */ /*else*/ { - __pyx_t_10 = __Pyx_PyUnicode_Concat(__pyx_v_arrstr, __pyx_kp_u_0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyUnicode_Concat(__pyx_v_arrstr, __pyx_kp_u_0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF_SET(__pyx_v_arrstr, ((PyObject*)__pyx_t_10)); __pyx_t_10 = 0; } __pyx_L8:; - /* "corels/_corels.pyx":131 + /* "corels/_corels.pyx":126 * for i in range(d0): * arrstr = "" * for j in range(d1): # <<<<<<<<<<<<<< @@ -2991,56 +2977,56 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "corels/_corels.pyx":137 + /* "corels/_corels.pyx":132 * arrstr += "0" * * bytestr = arrstr.encode("ascii") # <<<<<<<<<<<<<< * ncount = len(bytestr) * if ascii_to_vector(bytestr, ncount, &ncount, &nones, &vectors[i].truthtable) != 0: */ - __pyx_t_2 = PyUnicode_AsASCIIString(__pyx_v_arrstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_2 = PyUnicode_AsASCIIString(__pyx_v_arrstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_bytestr, __pyx_t_2); __pyx_t_2 = 0; - /* "corels/_corels.pyx":138 + /* "corels/_corels.pyx":133 * * bytestr = arrstr.encode("ascii") * ncount = len(bytestr) # <<<<<<<<<<<<<< * if ascii_to_vector(bytestr, ncount, &ncount, &nones, &vectors[i].truthtable) != 0: * for j in range(i): */ - __pyx_t_8 = PyObject_Length(__pyx_v_bytestr); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 138, __pyx_L1_error) + __pyx_t_8 = PyObject_Length(__pyx_v_bytestr); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 133, __pyx_L1_error) __pyx_v_ncount = __pyx_t_8; - /* "corels/_corels.pyx":139 + /* "corels/_corels.pyx":134 * bytestr = arrstr.encode("ascii") * ncount = len(bytestr) * if ascii_to_vector(bytestr, ncount, &ncount, &nones, &vectors[i].truthtable) != 0: # <<<<<<<<<<<<<< * for j in range(i): * rule_vfree(&vectors[j].truthtable) */ - __pyx_t_11 = __Pyx_PyObject_AsWritableString(__pyx_v_bytestr); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) __PYX_ERR(0, 139, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_AsWritableString(__pyx_v_bytestr); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L1_error) __pyx_t_4 = ((ascii_to_vector(__pyx_t_11, __pyx_v_ncount, (&__pyx_v_ncount), (&__pyx_v_nones), (&(__pyx_v_vectors[__pyx_t_8]).truthtable)) != 0) != 0); if (__pyx_t_4) { - /* "corels/_corels.pyx":140 + /* "corels/_corels.pyx":135 * ncount = len(bytestr) * if ascii_to_vector(bytestr, ncount, &ncount, &nones, &vectors[i].truthtable) != 0: * for j in range(i): # <<<<<<<<<<<<<< * rule_vfree(&vectors[j].truthtable) * */ - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_10 = __pyx_t_2; __Pyx_INCREF(__pyx_t_10); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = Py_TYPE(__pyx_t_10)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_9 = Py_TYPE(__pyx_t_10)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 135, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -3048,17 +3034,17 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int if (likely(PyList_CheckExact(__pyx_t_10))) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_10)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 135, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_10, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_10, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_10)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 135, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_10, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_10, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -3068,7 +3054,7 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 140, __pyx_L1_error) + else __PYX_ERR(0, 135, __pyx_L1_error) } break; } @@ -3077,17 +3063,17 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_2); __pyx_t_2 = 0; - /* "corels/_corels.pyx":141 + /* "corels/_corels.pyx":136 * if ascii_to_vector(bytestr, ncount, &ncount, &nones, &vectors[i].truthtable) != 0: * for j in range(i): * rule_vfree(&vectors[j].truthtable) # <<<<<<<<<<<<<< * * free(vectors) */ - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_v_j); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_v_j); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error) (void)(rule_vfree((&(__pyx_v_vectors[__pyx_t_12]).truthtable))); - /* "corels/_corels.pyx":140 + /* "corels/_corels.pyx":135 * ncount = len(bytestr) * if ascii_to_vector(bytestr, ncount, &ncount, &nones, &vectors[i].truthtable) != 0: * for j in range(i): # <<<<<<<<<<<<<< @@ -3097,7 +3083,7 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "corels/_corels.pyx":143 + /* "corels/_corels.pyx":138 * rule_vfree(&vectors[j].truthtable) * * free(vectors) # <<<<<<<<<<<<<< @@ -3106,20 +3092,20 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int */ free(__pyx_v_vectors); - /* "corels/_corels.pyx":144 + /* "corels/_corels.pyx":139 * * free(vectors) * raise ValueError("Could not load samples") # <<<<<<<<<<<<<< * * ncount_out[0] = ncount */ - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_Raise(__pyx_t_10, 0, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __PYX_ERR(0, 144, __pyx_L1_error) + __PYX_ERR(0, 139, __pyx_L1_error) - /* "corels/_corels.pyx":139 + /* "corels/_corels.pyx":134 * bytestr = arrstr.encode("ascii") * ncount = len(bytestr) * if ascii_to_vector(bytestr, ncount, &ncount, &nones, &vectors[i].truthtable) != 0: # <<<<<<<<<<<<<< @@ -3128,56 +3114,46 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int */ } - /* "corels/_corels.pyx":146 + /* "corels/_corels.pyx":141 * raise ValueError("Could not load samples") * * ncount_out[0] = ncount # <<<<<<<<<<<<<< * - * vectors[i].ids = NULL + * vectors[i].features = NULL */ (__pyx_v_ncount_out[0]) = __pyx_v_ncount; - /* "corels/_corels.pyx":148 + /* "corels/_corels.pyx":143 * ncount_out[0] = ncount * - * vectors[i].ids = NULL # <<<<<<<<<<<<<< - * vectors[i].features = NULL - * vectors[i].cardinality = 1 - */ - __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L1_error) - (__pyx_v_vectors[__pyx_t_8]).ids = NULL; - - /* "corels/_corels.pyx":149 - * - * vectors[i].ids = NULL * vectors[i].features = NULL # <<<<<<<<<<<<<< * vectors[i].cardinality = 1 * vectors[i].support = nones */ - __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L1_error) (__pyx_v_vectors[__pyx_t_8]).features = NULL; - /* "corels/_corels.pyx":150 - * vectors[i].ids = NULL + /* "corels/_corels.pyx":144 + * * vectors[i].features = NULL * vectors[i].cardinality = 1 # <<<<<<<<<<<<<< * vectors[i].support = nones * */ - __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 144, __pyx_L1_error) (__pyx_v_vectors[__pyx_t_8]).cardinality = 1; - /* "corels/_corels.pyx":151 + /* "corels/_corels.pyx":145 * vectors[i].features = NULL * vectors[i].cardinality = 1 * vectors[i].support = nones # <<<<<<<<<<<<<< * * return vectors */ - __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 145, __pyx_L1_error) (__pyx_v_vectors[__pyx_t_8]).support = __pyx_v_nones; - /* "corels/_corels.pyx":129 + /* "corels/_corels.pyx":124 * cdef int nones, ncount; * * for i in range(d0): # <<<<<<<<<<<<<< @@ -3187,7 +3163,7 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "corels/_corels.pyx":153 + /* "corels/_corels.pyx":147 * vectors[i].support = nones * * return vectors # <<<<<<<<<<<<<< @@ -3197,7 +3173,7 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int __pyx_r = __pyx_v_vectors; goto __pyx_L0; - /* "corels/_corels.pyx":120 + /* "corels/_corels.pyx":115 * return out * * cdef rule_t* _to_vector(np.ndarray[np.uint8_t, ndim=2] X, int* ncount_out): # <<<<<<<<<<<<<< @@ -3232,7 +3208,7 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int return __pyx_r; } -/* "corels/_corels.pyx":155 +/* "corels/_corels.pyx":149 * return vectors * * cdef _free_vector(rule_t* vs, int count): # <<<<<<<<<<<<<< @@ -3250,7 +3226,7 @@ static PyObject *__pyx_f_6corels_7_corels__free_vector(rule_t *__pyx_v_vs, int _ int __pyx_t_4; __Pyx_RefNannySetupContext("_free_vector", 0); - /* "corels/_corels.pyx":156 + /* "corels/_corels.pyx":150 * * cdef _free_vector(rule_t* vs, int count): * if vs == NULL: # <<<<<<<<<<<<<< @@ -3260,7 +3236,7 @@ static PyObject *__pyx_f_6corels_7_corels__free_vector(rule_t *__pyx_v_vs, int _ __pyx_t_1 = ((__pyx_v_vs == NULL) != 0); if (__pyx_t_1) { - /* "corels/_corels.pyx":157 + /* "corels/_corels.pyx":151 * cdef _free_vector(rule_t* vs, int count): * if vs == NULL: * return # <<<<<<<<<<<<<< @@ -3271,7 +3247,7 @@ static PyObject *__pyx_f_6corels_7_corels__free_vector(rule_t *__pyx_v_vs, int _ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "corels/_corels.pyx":156 + /* "corels/_corels.pyx":150 * * cdef _free_vector(rule_t* vs, int count): * if vs == NULL: # <<<<<<<<<<<<<< @@ -3280,57 +3256,29 @@ static PyObject *__pyx_f_6corels_7_corels__free_vector(rule_t *__pyx_v_vs, int _ */ } - /* "corels/_corels.pyx":159 + /* "corels/_corels.pyx":153 * return * * for i in range(count): # <<<<<<<<<<<<<< * rule_vfree(&vs[i].truthtable) - * if vs[i].ids: + * */ __pyx_t_2 = __pyx_v_count; __pyx_t_3 = __pyx_t_2; for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "corels/_corels.pyx":160 + /* "corels/_corels.pyx":154 * * for i in range(count): * rule_vfree(&vs[i].truthtable) # <<<<<<<<<<<<<< - * if vs[i].ids: - * free(vs[i].ids) - */ - (void)(rule_vfree((&(__pyx_v_vs[__pyx_v_i]).truthtable))); - - /* "corels/_corels.pyx":161 - * for i in range(count): - * rule_vfree(&vs[i].truthtable) - * if vs[i].ids: # <<<<<<<<<<<<<< - * free(vs[i].ids) - * - */ - __pyx_t_1 = ((__pyx_v_vs[__pyx_v_i]).ids != 0); - if (__pyx_t_1) { - - /* "corels/_corels.pyx":162 - * rule_vfree(&vs[i].truthtable) - * if vs[i].ids: - * free(vs[i].ids) # <<<<<<<<<<<<<< * * if vs[i].features: */ - free((__pyx_v_vs[__pyx_v_i]).ids); + (void)(rule_vfree((&(__pyx_v_vs[__pyx_v_i]).truthtable))); - /* "corels/_corels.pyx":161 - * for i in range(count): + /* "corels/_corels.pyx":156 * rule_vfree(&vs[i].truthtable) - * if vs[i].ids: # <<<<<<<<<<<<<< - * free(vs[i].ids) - * - */ - } - - /* "corels/_corels.pyx":164 - * free(vs[i].ids) * * if vs[i].features: # <<<<<<<<<<<<<< * free(vs[i].features) @@ -3339,7 +3287,7 @@ static PyObject *__pyx_f_6corels_7_corels__free_vector(rule_t *__pyx_v_vs, int _ __pyx_t_1 = ((__pyx_v_vs[__pyx_v_i]).features != 0); if (__pyx_t_1) { - /* "corels/_corels.pyx":165 + /* "corels/_corels.pyx":157 * * if vs[i].features: * free(vs[i].features) # <<<<<<<<<<<<<< @@ -3348,8 +3296,8 @@ static PyObject *__pyx_f_6corels_7_corels__free_vector(rule_t *__pyx_v_vs, int _ */ free((__pyx_v_vs[__pyx_v_i]).features); - /* "corels/_corels.pyx":164 - * free(vs[i].ids) + /* "corels/_corels.pyx":156 + * rule_vfree(&vs[i].truthtable) * * if vs[i].features: # <<<<<<<<<<<<<< * free(vs[i].features) @@ -3358,7 +3306,7 @@ static PyObject *__pyx_f_6corels_7_corels__free_vector(rule_t *__pyx_v_vs, int _ } } - /* "corels/_corels.pyx":167 + /* "corels/_corels.pyx":159 * free(vs[i].features) * * free(vs) # <<<<<<<<<<<<<< @@ -3367,7 +3315,7 @@ static PyObject *__pyx_f_6corels_7_corels__free_vector(rule_t *__pyx_v_vs, int _ */ free(__pyx_v_vs); - /* "corels/_corels.pyx":155 + /* "corels/_corels.pyx":149 * return vectors * * cdef _free_vector(rule_t* vs, int count): # <<<<<<<<<<<<<< @@ -3383,7 +3331,7 @@ static PyObject *__pyx_f_6corels_7_corels__free_vector(rule_t *__pyx_v_vs, int _ return __pyx_r; } -/* "corels/_corels.pyx":179 +/* "corels/_corels.pyx":171 * cdef set[string] run_verbosity * * def fit_wrap_begin(np.ndarray[np.uint8_t, ndim=2] samples, # <<<<<<<<<<<<<< @@ -3409,6 +3357,8 @@ static PyObject *__pyx_pw_6corels_7_corels_3fit_wrap_begin(PyObject *__pyx_self, int __pyx_v_ablation; int __pyx_v_calculate_size; int __pyx_v_pre_mine; + int __pyx_v_num_threads; + int __pyx_v_max_num_nodes; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -3416,12 +3366,16 @@ static PyObject *__pyx_pw_6corels_7_corels_3fit_wrap_begin(PyObject *__pyx_self, __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fit_wrap_begin (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_samples,&__pyx_n_s_labels,&__pyx_n_s_features,&__pyx_n_s_max_card,&__pyx_n_s_min_support,&__pyx_n_s_verbosity_str,&__pyx_n_s_mine_verbose,&__pyx_n_s_minor_verbose,&__pyx_n_s_c,&__pyx_n_s_policy,&__pyx_n_s_map_type,&__pyx_n_s_ablation,&__pyx_n_s_calculate_size,&__pyx_n_s_pre_mine,0}; - PyObject* values[14] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_samples,&__pyx_n_s_labels,&__pyx_n_s_features,&__pyx_n_s_max_card,&__pyx_n_s_min_support,&__pyx_n_s_verbosity_str,&__pyx_n_s_mine_verbose,&__pyx_n_s_minor_verbose,&__pyx_n_s_c,&__pyx_n_s_policy,&__pyx_n_s_map_type,&__pyx_n_s_ablation,&__pyx_n_s_calculate_size,&__pyx_n_s_pre_mine,&__pyx_n_s_num_threads,&__pyx_n_s_max_num_nodes,0}; + PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,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 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15); + CYTHON_FALLTHROUGH; + case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14); + CYTHON_FALLTHROUGH; case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); CYTHON_FALLTHROUGH; case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); @@ -3462,85 +3416,97 @@ static PyObject *__pyx_pw_6corels_7_corels_3fit_wrap_begin(PyObject *__pyx_self, case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 14, 14, 1); __PYX_ERR(0, 179, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 16, 16, 1); __PYX_ERR(0, 171, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_features)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 14, 14, 2); __PYX_ERR(0, 179, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 16, 16, 2); __PYX_ERR(0, 171, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_card)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 14, 14, 3); __PYX_ERR(0, 179, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 16, 16, 3); __PYX_ERR(0, 171, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_support)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 14, 14, 4); __PYX_ERR(0, 179, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 16, 16, 4); __PYX_ERR(0, 171, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_verbosity_str)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 14, 14, 5); __PYX_ERR(0, 179, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 16, 16, 5); __PYX_ERR(0, 171, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mine_verbose)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 14, 14, 6); __PYX_ERR(0, 179, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 16, 16, 6); __PYX_ERR(0, 171, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minor_verbose)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 14, 14, 7); __PYX_ERR(0, 179, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 16, 16, 7); __PYX_ERR(0, 171, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 8: if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_c)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 14, 14, 8); __PYX_ERR(0, 179, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 16, 16, 8); __PYX_ERR(0, 171, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 9: if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_policy)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 14, 14, 9); __PYX_ERR(0, 179, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 16, 16, 9); __PYX_ERR(0, 171, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 10: if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_map_type)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 14, 14, 10); __PYX_ERR(0, 179, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 16, 16, 10); __PYX_ERR(0, 171, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 11: if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ablation)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 14, 14, 11); __PYX_ERR(0, 179, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 16, 16, 11); __PYX_ERR(0, 171, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 12: if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_calculate_size)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 14, 14, 12); __PYX_ERR(0, 179, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 16, 16, 12); __PYX_ERR(0, 171, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 13: if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pre_mine)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 14, 14, 13); __PYX_ERR(0, 179, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 16, 16, 13); __PYX_ERR(0, 171, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 14: + if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_threads)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 16, 16, 14); __PYX_ERR(0, 171, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 15: + if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_num_nodes)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 16, 16, 15); __PYX_ERR(0, 171, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fit_wrap_begin") < 0)) __PYX_ERR(0, 179, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fit_wrap_begin") < 0)) __PYX_ERR(0, 171, __pyx_L3_error) } - } else if (PyTuple_GET_SIZE(__pyx_args) != 14) { + } else if (PyTuple_GET_SIZE(__pyx_args) != 16) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); @@ -3557,33 +3523,37 @@ static PyObject *__pyx_pw_6corels_7_corels_3fit_wrap_begin(PyObject *__pyx_self, values[11] = PyTuple_GET_ITEM(__pyx_args, 11); values[12] = PyTuple_GET_ITEM(__pyx_args, 12); values[13] = PyTuple_GET_ITEM(__pyx_args, 13); + values[14] = PyTuple_GET_ITEM(__pyx_args, 14); + values[15] = PyTuple_GET_ITEM(__pyx_args, 15); } __pyx_v_samples = ((PyArrayObject *)values[0]); __pyx_v_labels = ((PyArrayObject *)values[1]); __pyx_v_features = values[2]; - __pyx_v_max_card = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_max_card == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L3_error) - __pyx_v_min_support = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_min_support == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L3_error) + __pyx_v_max_card = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_max_card == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 173, __pyx_L3_error) + __pyx_v_min_support = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_min_support == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 173, __pyx_L3_error) __pyx_v_verbosity_str = values[5]; - __pyx_v_mine_verbose = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_mine_verbose == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L3_error) - __pyx_v_minor_verbose = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_minor_verbose == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L3_error) - __pyx_v_c = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_c == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L3_error) - __pyx_v_policy = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L3_error) - __pyx_v_map_type = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_map_type == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L3_error) - __pyx_v_ablation = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_ablation == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L3_error) - __pyx_v_calculate_size = __Pyx_PyInt_As_int(values[12]); if (unlikely((__pyx_v_calculate_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 183, __pyx_L3_error) - __pyx_v_pre_mine = __Pyx_PyInt_As_int(values[13]); if (unlikely((__pyx_v_pre_mine == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 183, __pyx_L3_error) + __pyx_v_mine_verbose = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_mine_verbose == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 173, __pyx_L3_error) + __pyx_v_minor_verbose = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_minor_verbose == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 174, __pyx_L3_error) + __pyx_v_c = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_c == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 174, __pyx_L3_error) + __pyx_v_policy = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 174, __pyx_L3_error) + __pyx_v_map_type = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_map_type == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 174, __pyx_L3_error) + __pyx_v_ablation = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_ablation == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 174, __pyx_L3_error) + __pyx_v_calculate_size = __Pyx_PyInt_As_int(values[12]); if (unlikely((__pyx_v_calculate_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L3_error) + __pyx_v_pre_mine = __Pyx_PyInt_As_int(values[13]); if (unlikely((__pyx_v_pre_mine == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L3_error) + __pyx_v_num_threads = __Pyx_PyInt_As_int(values[14]); if (unlikely((__pyx_v_num_threads == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L3_error) + __pyx_v_max_num_nodes = __Pyx_PyInt_As_int(values[15]); if (unlikely((__pyx_v_max_num_nodes == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 14, 14, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 179, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 16, 16, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 171, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("corels._corels.fit_wrap_begin", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_samples), __pyx_ptype_5numpy_ndarray, 1, "samples", 0))) __PYX_ERR(0, 179, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 180, __pyx_L1_error) - __pyx_r = __pyx_pf_6corels_7_corels_2fit_wrap_begin(__pyx_self, __pyx_v_samples, __pyx_v_labels, __pyx_v_features, __pyx_v_max_card, __pyx_v_min_support, __pyx_v_verbosity_str, __pyx_v_mine_verbose, __pyx_v_minor_verbose, __pyx_v_c, __pyx_v_policy, __pyx_v_map_type, __pyx_v_ablation, __pyx_v_calculate_size, __pyx_v_pre_mine); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_samples), __pyx_ptype_5numpy_ndarray, 1, "samples", 0))) __PYX_ERR(0, 171, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_r = __pyx_pf_6corels_7_corels_2fit_wrap_begin(__pyx_self, __pyx_v_samples, __pyx_v_labels, __pyx_v_features, __pyx_v_max_card, __pyx_v_min_support, __pyx_v_verbosity_str, __pyx_v_mine_verbose, __pyx_v_minor_verbose, __pyx_v_c, __pyx_v_policy, __pyx_v_map_type, __pyx_v_ablation, __pyx_v_calculate_size, __pyx_v_pre_mine, __pyx_v_num_threads, __pyx_v_max_num_nodes); /* function exit code */ goto __pyx_L0; @@ -3594,20 +3564,24 @@ static PyObject *__pyx_pw_6corels_7_corels_3fit_wrap_begin(PyObject *__pyx_self, return __pyx_r; } -static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_samples, PyArrayObject *__pyx_v_labels, PyObject *__pyx_v_features, int __pyx_v_max_card, double __pyx_v_min_support, PyObject *__pyx_v_verbosity_str, int __pyx_v_mine_verbose, int __pyx_v_minor_verbose, double __pyx_v_c, int __pyx_v_policy, int __pyx_v_map_type, int __pyx_v_ablation, int __pyx_v_calculate_size, int __pyx_v_pre_mine) { +static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_samples, PyArrayObject *__pyx_v_labels, PyObject *__pyx_v_features, int __pyx_v_max_card, double __pyx_v_min_support, PyObject *__pyx_v_verbosity_str, int __pyx_v_mine_verbose, int __pyx_v_minor_verbose, double __pyx_v_c, int __pyx_v_policy, int __pyx_v_map_type, int __pyx_v_ablation, int __pyx_v_calculate_size, int __pyx_v_pre_mine, int __pyx_v_num_threads, int __pyx_v_max_num_nodes) { int __pyx_v_nfeatures; rule_t *__pyx_v_samples_vecs; PyObject *__pyx_v_nsamples = NULL; char **__pyx_v_features_vec; - int __pyx_v_i; + std::vector ::size_type __pyx_v_i; PyObject *__pyx_v_bytestr = NULL; - int __pyx_v_j; + std::vector ::size_type __pyx_v_j; int __pyx_v_r; PyObject *__pyx_v_verbosity_ascii = NULL; char *__pyx_v_verbosity; int __pyx_v_nsamples_chk; + int __pyx_v_minor_count; int __pyx_v_mr; - int __pyx_v_rb; + std::vector __pyx_v_rulelist; + std::vector __pyx_v_classes; + double __pyx_v_rb; + PyObject *__pyx_v_r_out = NULL; __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; __Pyx_Buffer __pyx_pybuffer_labels; __Pyx_LocalBuf_ND __pyx_pybuffernd_samples; @@ -3621,16 +3595,18 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; - int __pyx_t_8; + std::vector ::size_type __pyx_t_8; char const *__pyx_t_9; - int __pyx_t_10; - int __pyx_t_11; - int __pyx_t_12; + std::vector ::size_type __pyx_t_10; + std::vector ::size_type __pyx_t_11; + std::vector ::size_type __pyx_t_12; int __pyx_t_13; - char *__pyx_t_14; - PyObject *__pyx_t_15 = NULL; + int __pyx_t_14; + char *__pyx_t_15; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + int __pyx_t_19; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -3645,16 +3621,16 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_samples.rcbuffer->pybuffer, (PyObject*)__pyx_v_samples, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 179, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_samples.rcbuffer->pybuffer, (PyObject*)__pyx_v_samples, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 171, __pyx_L1_error) } __pyx_pybuffernd_samples.diminfo[0].strides = __pyx_pybuffernd_samples.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_samples.diminfo[0].shape = __pyx_pybuffernd_samples.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_samples.diminfo[1].strides = __pyx_pybuffernd_samples.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_samples.diminfo[1].shape = __pyx_pybuffernd_samples.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 179, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 171, __pyx_L1_error) } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_labels.diminfo[1].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_labels.diminfo[1].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[1]; - /* "corels/_corels.pyx":189 + /* "corels/_corels.pyx":181 * global n_rules * * cdef int nfeatures = 0 # <<<<<<<<<<<<<< @@ -3663,7 +3639,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_nfeatures = 0; - /* "corels/_corels.pyx":190 + /* "corels/_corels.pyx":182 * * cdef int nfeatures = 0 * cdef rule_t* samples_vecs = _to_vector(samples, &nfeatures) # <<<<<<<<<<<<<< @@ -3672,30 +3648,30 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_samples_vecs = __pyx_f_6corels_7_corels__to_vector(((PyArrayObject *)__pyx_v_samples), (&__pyx_v_nfeatures)); - /* "corels/_corels.pyx":192 + /* "corels/_corels.pyx":184 * cdef rule_t* samples_vecs = _to_vector(samples, &nfeatures) * * nsamples = samples.shape[0] # <<<<<<<<<<<<<< * * if nfeatures > len(features): */ - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_samples->dimensions[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_samples->dimensions[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_nsamples = __pyx_t_1; __pyx_t_1 = 0; - /* "corels/_corels.pyx":194 + /* "corels/_corels.pyx":186 * nsamples = samples.shape[0] * * if nfeatures > len(features): # <<<<<<<<<<<<<< * if samples_vecs != NULL: * _free_vector(samples_vecs, nsamples) */ - __pyx_t_2 = PyObject_Length(__pyx_v_features); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 194, __pyx_L1_error) + __pyx_t_2 = PyObject_Length(__pyx_v_features); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 186, __pyx_L1_error) __pyx_t_3 = ((__pyx_v_nfeatures > __pyx_t_2) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":195 + /* "corels/_corels.pyx":187 * * if nfeatures > len(features): * if samples_vecs != NULL: # <<<<<<<<<<<<<< @@ -3705,19 +3681,19 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = ((__pyx_v_samples_vecs != NULL) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":196 + /* "corels/_corels.pyx":188 * if nfeatures > len(features): * if samples_vecs != NULL: * _free_vector(samples_vecs, nsamples) # <<<<<<<<<<<<<< * samples_vecs = NULL * raise ValueError("Feature count mismatch between sample data (" + str(nfeatures) + */ - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_nsamples); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 196, __pyx_L1_error) - __pyx_t_1 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_samples_vecs, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_nsamples); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 188, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_samples_vecs, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "corels/_corels.pyx":197 + /* "corels/_corels.pyx":189 * if samples_vecs != NULL: * _free_vector(samples_vecs, nsamples) * samples_vecs = NULL # <<<<<<<<<<<<<< @@ -3726,7 +3702,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_samples_vecs = NULL; - /* "corels/_corels.pyx":195 + /* "corels/_corels.pyx":187 * * if nfeatures > len(features): * if samples_vecs != NULL: # <<<<<<<<<<<<<< @@ -3735,61 +3711,61 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":198 + /* "corels/_corels.pyx":190 * _free_vector(samples_vecs, nsamples) * samples_vecs = NULL * raise ValueError("Feature count mismatch between sample data (" + str(nfeatures) + # <<<<<<<<<<<<<< * ") and feature names (" + str(len(features)) + ")") * */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nfeatures); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nfeatures); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 198, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Feature_count_mismatch_between_s, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Feature_count_mismatch_between_s, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_t_1, __pyx_kp_u_and_feature_names); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 198, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_t_1, __pyx_kp_u_and_feature_names); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "corels/_corels.pyx":199 + /* "corels/_corels.pyx":191 * samples_vecs = NULL * raise ValueError("Feature count mismatch between sample data (" + str(nfeatures) + * ") and feature names (" + str(len(features)) + ")") # <<<<<<<<<<<<<< * * cdef char** features_vec = malloc(nfeatures * sizeof(char*)) */ - __pyx_t_2 = PyObject_Length(__pyx_v_features); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 199, __pyx_L1_error) - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error) + __pyx_t_2 = PyObject_Length(__pyx_v_features); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 191, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 199, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_t_1, __pyx_kp_u__3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 199, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_t_1, __pyx_kp_u__3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "corels/_corels.pyx":198 + /* "corels/_corels.pyx":190 * _free_vector(samples_vecs, nsamples) * samples_vecs = NULL * raise ValueError("Feature count mismatch between sample data (" + str(nfeatures) + # <<<<<<<<<<<<<< * ") and feature names (" + str(len(features)) + ")") * */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 198, __pyx_L1_error) + __PYX_ERR(0, 190, __pyx_L1_error) - /* "corels/_corels.pyx":194 + /* "corels/_corels.pyx":186 * nsamples = samples.shape[0] * * if nfeatures > len(features): # <<<<<<<<<<<<<< @@ -3798,7 +3774,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":201 + /* "corels/_corels.pyx":193 * ") and feature names (" + str(len(features)) + ")") * * cdef char** features_vec = malloc(nfeatures * sizeof(char*)) # <<<<<<<<<<<<<< @@ -3807,7 +3783,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_features_vec = ((char **)malloc((__pyx_v_nfeatures * (sizeof(char *))))); - /* "corels/_corels.pyx":202 + /* "corels/_corels.pyx":194 * * cdef char** features_vec = malloc(nfeatures * sizeof(char*)) * if features_vec == NULL: # <<<<<<<<<<<<<< @@ -3817,7 +3793,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = ((__pyx_v_features_vec == NULL) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":203 + /* "corels/_corels.pyx":195 * cdef char** features_vec = malloc(nfeatures * sizeof(char*)) * if features_vec == NULL: * if samples_vecs != NULL: # <<<<<<<<<<<<<< @@ -3827,19 +3803,19 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = ((__pyx_v_samples_vecs != NULL) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":204 + /* "corels/_corels.pyx":196 * if features_vec == NULL: * if samples_vecs != NULL: * _free_vector(samples_vecs, nsamples) # <<<<<<<<<<<<<< * samples_vecs = NULL * raise MemoryError() */ - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_nsamples); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 204, __pyx_L1_error) - __pyx_t_1 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_samples_vecs, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_nsamples); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 196, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_samples_vecs, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "corels/_corels.pyx":205 + /* "corels/_corels.pyx":197 * if samples_vecs != NULL: * _free_vector(samples_vecs, nsamples) * samples_vecs = NULL # <<<<<<<<<<<<<< @@ -3848,7 +3824,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_samples_vecs = NULL; - /* "corels/_corels.pyx":203 + /* "corels/_corels.pyx":195 * cdef char** features_vec = malloc(nfeatures * sizeof(char*)) * if features_vec == NULL: * if samples_vecs != NULL: # <<<<<<<<<<<<<< @@ -3857,16 +3833,16 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":206 + /* "corels/_corels.pyx":198 * _free_vector(samples_vecs, nsamples) * samples_vecs = NULL * raise MemoryError() # <<<<<<<<<<<<<< * * for i in range(nfeatures): */ - PyErr_NoMemory(); __PYX_ERR(0, 206, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(0, 198, __pyx_L1_error) - /* "corels/_corels.pyx":202 + /* "corels/_corels.pyx":194 * * cdef char** features_vec = malloc(nfeatures * sizeof(char*)) * if features_vec == NULL: # <<<<<<<<<<<<<< @@ -3875,7 +3851,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":208 + /* "corels/_corels.pyx":200 * raise MemoryError() * * for i in range(nfeatures): # <<<<<<<<<<<<<< @@ -3887,16 +3863,16 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; - /* "corels/_corels.pyx":209 + /* "corels/_corels.pyx":201 * * for i in range(nfeatures): * bytestr = features[i].encode("ascii") # <<<<<<<<<<<<<< * features_vec[i] = strdup(bytestr) * if features_vec[i] == NULL: */ - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_features, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_features, __pyx_v_i, std::vector ::size_type, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; @@ -3911,23 +3887,23 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec } __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_u_ascii) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_u_ascii); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_bytestr, __pyx_t_1); __pyx_t_1 = 0; - /* "corels/_corels.pyx":210 + /* "corels/_corels.pyx":202 * for i in range(nfeatures): * bytestr = features[i].encode("ascii") * features_vec[i] = strdup(bytestr) # <<<<<<<<<<<<<< * if features_vec[i] == NULL: * for j in range(i): */ - __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 210, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 202, __pyx_L1_error) (__pyx_v_features_vec[__pyx_v_i]) = strdup(__pyx_t_9); - /* "corels/_corels.pyx":211 + /* "corels/_corels.pyx":203 * bytestr = features[i].encode("ascii") * features_vec[i] = strdup(bytestr) * if features_vec[i] == NULL: # <<<<<<<<<<<<<< @@ -3937,7 +3913,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = (((__pyx_v_features_vec[__pyx_v_i]) == NULL) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":212 + /* "corels/_corels.pyx":204 * features_vec[i] = strdup(bytestr) * if features_vec[i] == NULL: * for j in range(i): # <<<<<<<<<<<<<< @@ -3949,7 +3925,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { __pyx_v_j = __pyx_t_12; - /* "corels/_corels.pyx":213 + /* "corels/_corels.pyx":205 * if features_vec[i] == NULL: * for j in range(i): * if features_vec[j] != NULL: # <<<<<<<<<<<<<< @@ -3959,7 +3935,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = (((__pyx_v_features_vec[__pyx_v_j]) != NULL) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":214 + /* "corels/_corels.pyx":206 * for j in range(i): * if features_vec[j] != NULL: * free(features_vec[j]) # <<<<<<<<<<<<<< @@ -3968,7 +3944,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ free((__pyx_v_features_vec[__pyx_v_j])); - /* "corels/_corels.pyx":213 + /* "corels/_corels.pyx":205 * if features_vec[i] == NULL: * for j in range(i): * if features_vec[j] != NULL: # <<<<<<<<<<<<<< @@ -3978,7 +3954,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec } } - /* "corels/_corels.pyx":215 + /* "corels/_corels.pyx":207 * if features_vec[j] != NULL: * free(features_vec[j]) * features_vec = NULL # <<<<<<<<<<<<<< @@ -3987,7 +3963,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_features_vec = NULL; - /* "corels/_corels.pyx":216 + /* "corels/_corels.pyx":208 * free(features_vec[j]) * features_vec = NULL * if samples_vecs != NULL: # <<<<<<<<<<<<<< @@ -3997,19 +3973,19 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = ((__pyx_v_samples_vecs != NULL) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":217 + /* "corels/_corels.pyx":209 * features_vec = NULL * if samples_vecs != NULL: * _free_vector(samples_vecs, nsamples) # <<<<<<<<<<<<<< * samples_vecs = NULL * raise MemoryError() */ - __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_nsamples); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 217, __pyx_L1_error) - __pyx_t_1 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_samples_vecs, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_v_nsamples); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_samples_vecs, __pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "corels/_corels.pyx":218 + /* "corels/_corels.pyx":210 * if samples_vecs != NULL: * _free_vector(samples_vecs, nsamples) * samples_vecs = NULL # <<<<<<<<<<<<<< @@ -4018,7 +3994,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_samples_vecs = NULL; - /* "corels/_corels.pyx":216 + /* "corels/_corels.pyx":208 * free(features_vec[j]) * features_vec = NULL * if samples_vecs != NULL: # <<<<<<<<<<<<<< @@ -4027,16 +4003,16 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":219 + /* "corels/_corels.pyx":211 * _free_vector(samples_vecs, nsamples) * samples_vecs = NULL * raise MemoryError() # <<<<<<<<<<<<<< * * if rules != NULL: */ - PyErr_NoMemory(); __PYX_ERR(0, 219, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(0, 211, __pyx_L1_error) - /* "corels/_corels.pyx":211 + /* "corels/_corels.pyx":203 * bytestr = features[i].encode("ascii") * features_vec[i] = strdup(bytestr) * if features_vec[i] == NULL: # <<<<<<<<<<<<<< @@ -4046,7 +4022,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec } } - /* "corels/_corels.pyx":221 + /* "corels/_corels.pyx":213 * raise MemoryError() * * if rules != NULL: # <<<<<<<<<<<<<< @@ -4056,18 +4032,18 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = ((__pyx_v_6corels_7_corels_rules != NULL) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":222 + /* "corels/_corels.pyx":214 * * if rules != NULL: * _free_vector(rules, n_rules) # <<<<<<<<<<<<<< * rules = NULL * n_rules = 0 */ - __pyx_t_1 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_rules, __pyx_v_6corels_7_corels_n_rules); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_rules, __pyx_v_6corels_7_corels_n_rules); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "corels/_corels.pyx":223 + /* "corels/_corels.pyx":215 * if rules != NULL: * _free_vector(rules, n_rules) * rules = NULL # <<<<<<<<<<<<<< @@ -4076,7 +4052,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_6corels_7_corels_rules = NULL; - /* "corels/_corels.pyx":221 + /* "corels/_corels.pyx":213 * raise MemoryError() * * if rules != NULL: # <<<<<<<<<<<<<< @@ -4085,7 +4061,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":224 + /* "corels/_corels.pyx":216 * _free_vector(rules, n_rules) * rules = NULL * n_rules = 0 # <<<<<<<<<<<<<< @@ -4094,16 +4070,16 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_6corels_7_corels_n_rules = 0; - /* "corels/_corels.pyx":226 + /* "corels/_corels.pyx":218 * n_rules = 0 * * cdef int r = mine_rules(features_vec, samples_vecs, nfeatures, nsamples, # <<<<<<<<<<<<<< * max_card, min_support, &rules, mine_verbose, pre_mine) * */ - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_nsamples); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_nsamples); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 218, __pyx_L1_error) - /* "corels/_corels.pyx":227 + /* "corels/_corels.pyx":219 * * cdef int r = mine_rules(features_vec, samples_vecs, nfeatures, nsamples, * max_card, min_support, &rules, mine_verbose, pre_mine) # <<<<<<<<<<<<<< @@ -4112,7 +4088,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_r = mine_rules(__pyx_v_features_vec, __pyx_v_samples_vecs, __pyx_v_nfeatures, __pyx_t_4, __pyx_v_max_card, __pyx_v_min_support, (&__pyx_v_6corels_7_corels_rules), __pyx_v_mine_verbose, __pyx_v_pre_mine); - /* "corels/_corels.pyx":229 + /* "corels/_corels.pyx":221 * max_card, min_support, &rules, mine_verbose, pre_mine) * * if features_vec != NULL: # <<<<<<<<<<<<<< @@ -4122,7 +4098,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = ((__pyx_v_features_vec != NULL) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":230 + /* "corels/_corels.pyx":222 * * if features_vec != NULL: * for i in range(nfeatures): # <<<<<<<<<<<<<< @@ -4134,7 +4110,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; - /* "corels/_corels.pyx":231 + /* "corels/_corels.pyx":223 * if features_vec != NULL: * for i in range(nfeatures): * if features_vec[i] != NULL: # <<<<<<<<<<<<<< @@ -4144,7 +4120,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = (((__pyx_v_features_vec[__pyx_v_i]) != NULL) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":232 + /* "corels/_corels.pyx":224 * for i in range(nfeatures): * if features_vec[i] != NULL: * free(features_vec[i]) # <<<<<<<<<<<<<< @@ -4153,7 +4129,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ free((__pyx_v_features_vec[__pyx_v_i])); - /* "corels/_corels.pyx":231 + /* "corels/_corels.pyx":223 * if features_vec != NULL: * for i in range(nfeatures): * if features_vec[i] != NULL: # <<<<<<<<<<<<<< @@ -4163,7 +4139,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec } } - /* "corels/_corels.pyx":233 + /* "corels/_corels.pyx":225 * if features_vec[i] != NULL: * free(features_vec[i]) * free(features_vec) # <<<<<<<<<<<<<< @@ -4172,7 +4148,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ free(__pyx_v_features_vec); - /* "corels/_corels.pyx":234 + /* "corels/_corels.pyx":226 * free(features_vec[i]) * free(features_vec) * features_vec = NULL # <<<<<<<<<<<<<< @@ -4181,7 +4157,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_features_vec = NULL; - /* "corels/_corels.pyx":229 + /* "corels/_corels.pyx":221 * max_card, min_support, &rules, mine_verbose, pre_mine) * * if features_vec != NULL: # <<<<<<<<<<<<<< @@ -4190,7 +4166,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":236 + /* "corels/_corels.pyx":228 * features_vec = NULL * * if samples_vecs != NULL: # <<<<<<<<<<<<<< @@ -4200,19 +4176,19 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = ((__pyx_v_samples_vecs != NULL) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":237 + /* "corels/_corels.pyx":229 * * if samples_vecs != NULL: * _free_vector(samples_vecs, nsamples) # <<<<<<<<<<<<<< * samples_vecs = NULL * */ - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_nsamples); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 237, __pyx_L1_error) - __pyx_t_1 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_samples_vecs, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_nsamples); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 229, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_samples_vecs, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "corels/_corels.pyx":238 + /* "corels/_corels.pyx":230 * if samples_vecs != NULL: * _free_vector(samples_vecs, nsamples) * samples_vecs = NULL # <<<<<<<<<<<<<< @@ -4221,7 +4197,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_samples_vecs = NULL; - /* "corels/_corels.pyx":236 + /* "corels/_corels.pyx":228 * features_vec = NULL * * if samples_vecs != NULL: # <<<<<<<<<<<<<< @@ -4230,34 +4206,34 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":240 + /* "corels/_corels.pyx":232 * samples_vecs = NULL * * if r == -1 or rules == NULL: # <<<<<<<<<<<<<< * raise MemoryError(); * */ - __pyx_t_13 = ((__pyx_v_r == -1L) != 0); - if (!__pyx_t_13) { + __pyx_t_14 = ((__pyx_v_r == -1L) != 0); + if (!__pyx_t_14) { } else { - __pyx_t_3 = __pyx_t_13; + __pyx_t_3 = __pyx_t_14; goto __pyx_L21_bool_binop_done; } - __pyx_t_13 = ((__pyx_v_6corels_7_corels_rules == NULL) != 0); - __pyx_t_3 = __pyx_t_13; + __pyx_t_14 = ((__pyx_v_6corels_7_corels_rules == NULL) != 0); + __pyx_t_3 = __pyx_t_14; __pyx_L21_bool_binop_done:; if (unlikely(__pyx_t_3)) { - /* "corels/_corels.pyx":241 + /* "corels/_corels.pyx":233 * * if r == -1 or rules == NULL: * raise MemoryError(); # <<<<<<<<<<<<<< * * n_rules = r */ - PyErr_NoMemory(); __PYX_ERR(0, 241, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(0, 233, __pyx_L1_error) - /* "corels/_corels.pyx":240 + /* "corels/_corels.pyx":232 * samples_vecs = NULL * * if r == -1 or rules == NULL: # <<<<<<<<<<<<<< @@ -4266,7 +4242,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":243 + /* "corels/_corels.pyx":235 * raise MemoryError(); * * n_rules = r # <<<<<<<<<<<<<< @@ -4275,14 +4251,14 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_6corels_7_corels_n_rules = __pyx_v_r; - /* "corels/_corels.pyx":245 + /* "corels/_corels.pyx":237 * n_rules = r * * verbosity_ascii = verbosity_str.encode("ascii") # <<<<<<<<<<<<<< * cdef char* verbosity = verbosity_ascii * */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_verbosity_str, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 245, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_verbosity_str, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { @@ -4296,23 +4272,23 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec } __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_u_ascii) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_u_ascii); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_verbosity_ascii = __pyx_t_1; __pyx_t_1 = 0; - /* "corels/_corels.pyx":246 + /* "corels/_corels.pyx":238 * * verbosity_ascii = verbosity_str.encode("ascii") * cdef char* verbosity = verbosity_ascii # <<<<<<<<<<<<<< * * if labels_vecs != NULL: */ - __pyx_t_14 = __Pyx_PyObject_AsWritableString(__pyx_v_verbosity_ascii); if (unlikely((!__pyx_t_14) && PyErr_Occurred())) __PYX_ERR(0, 246, __pyx_L1_error) - __pyx_v_verbosity = __pyx_t_14; + __pyx_t_15 = __Pyx_PyObject_AsWritableString(__pyx_v_verbosity_ascii); if (unlikely((!__pyx_t_15) && PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_v_verbosity = __pyx_t_15; - /* "corels/_corels.pyx":248 + /* "corels/_corels.pyx":240 * cdef char* verbosity = verbosity_ascii * * if labels_vecs != NULL: # <<<<<<<<<<<<<< @@ -4322,18 +4298,18 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = ((__pyx_v_6corels_7_corels_labels_vecs != NULL) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":249 + /* "corels/_corels.pyx":241 * * if labels_vecs != NULL: * _free_vector(labels_vecs, 2) # <<<<<<<<<<<<<< * labels_vecs = NULL * */ - __pyx_t_1 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_labels_vecs, 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_labels_vecs, 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "corels/_corels.pyx":250 + /* "corels/_corels.pyx":242 * if labels_vecs != NULL: * _free_vector(labels_vecs, 2) * labels_vecs = NULL # <<<<<<<<<<<<<< @@ -4342,7 +4318,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_6corels_7_corels_labels_vecs = NULL; - /* "corels/_corels.pyx":248 + /* "corels/_corels.pyx":240 * cdef char* verbosity = verbosity_ascii * * if labels_vecs != NULL: # <<<<<<<<<<<<<< @@ -4351,7 +4327,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":252 + /* "corels/_corels.pyx":244 * labels_vecs = NULL * * cdef int nsamples_chk = 0 # <<<<<<<<<<<<<< @@ -4360,7 +4336,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_nsamples_chk = 0; - /* "corels/_corels.pyx":253 + /* "corels/_corels.pyx":245 * * cdef int nsamples_chk = 0 * try: # <<<<<<<<<<<<<< @@ -4368,10 +4344,10 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec * except: */ { - (void)__pyx_t_15; (void)__pyx_t_16; (void)__pyx_t_17; /* mark used */ + (void)__pyx_t_16; (void)__pyx_t_17; (void)__pyx_t_18; /* mark used */ /*try:*/ { - /* "corels/_corels.pyx":254 + /* "corels/_corels.pyx":246 * cdef int nsamples_chk = 0 * try: * labels_vecs = _to_vector(labels, &nsamples_chk) # <<<<<<<<<<<<<< @@ -4380,7 +4356,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_6corels_7_corels_labels_vecs = __pyx_f_6corels_7_corels__to_vector(((PyArrayObject *)__pyx_v_labels), (&__pyx_v_nsamples_chk)); - /* "corels/_corels.pyx":253 + /* "corels/_corels.pyx":245 * * cdef int nsamples_chk = 0 * try: # <<<<<<<<<<<<<< @@ -4390,22 +4366,22 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec } } - /* "corels/_corels.pyx":262 + /* "corels/_corels.pyx":254 * raise * * if nsamples_chk != nsamples: # <<<<<<<<<<<<<< * if labels_vecs != NULL: * _free_vector(labels_vecs, 2) */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nsamples_chk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nsamples_chk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_v_nsamples, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 262, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_v_nsamples, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 262, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_3) { - /* "corels/_corels.pyx":263 + /* "corels/_corels.pyx":255 * * if nsamples_chk != nsamples: * if labels_vecs != NULL: # <<<<<<<<<<<<<< @@ -4415,18 +4391,18 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = ((__pyx_v_6corels_7_corels_labels_vecs != NULL) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":264 + /* "corels/_corels.pyx":256 * if nsamples_chk != nsamples: * if labels_vecs != NULL: * _free_vector(labels_vecs, 2) # <<<<<<<<<<<<<< * labels_vecs = NULL * if rules != NULL: */ - __pyx_t_5 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_labels_vecs, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 264, __pyx_L1_error) + __pyx_t_5 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_labels_vecs, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "corels/_corels.pyx":265 + /* "corels/_corels.pyx":257 * if labels_vecs != NULL: * _free_vector(labels_vecs, 2) * labels_vecs = NULL # <<<<<<<<<<<<<< @@ -4435,7 +4411,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_6corels_7_corels_labels_vecs = NULL; - /* "corels/_corels.pyx":263 + /* "corels/_corels.pyx":255 * * if nsamples_chk != nsamples: * if labels_vecs != NULL: # <<<<<<<<<<<<<< @@ -4444,7 +4420,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":266 + /* "corels/_corels.pyx":258 * _free_vector(labels_vecs, 2) * labels_vecs = NULL * if rules != NULL: # <<<<<<<<<<<<<< @@ -4454,18 +4430,18 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = ((__pyx_v_6corels_7_corels_rules != NULL) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":267 + /* "corels/_corels.pyx":259 * labels_vecs = NULL * if rules != NULL: * _free_vector(rules, n_rules) # <<<<<<<<<<<<<< * rules = NULL * n_rules = 0 */ - __pyx_t_5 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_rules, __pyx_v_6corels_7_corels_n_rules); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 267, __pyx_L1_error) + __pyx_t_5 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_rules, __pyx_v_6corels_7_corels_n_rules); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "corels/_corels.pyx":268 + /* "corels/_corels.pyx":260 * if rules != NULL: * _free_vector(rules, n_rules) * rules = NULL # <<<<<<<<<<<<<< @@ -4474,7 +4450,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_6corels_7_corels_rules = NULL; - /* "corels/_corels.pyx":266 + /* "corels/_corels.pyx":258 * _free_vector(labels_vecs, 2) * labels_vecs = NULL * if rules != NULL: # <<<<<<<<<<<<<< @@ -4483,7 +4459,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":269 + /* "corels/_corels.pyx":261 * _free_vector(rules, n_rules) * rules = NULL * n_rules = 0 # <<<<<<<<<<<<<< @@ -4492,57 +4468,57 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_6corels_7_corels_n_rules = 0; - /* "corels/_corels.pyx":270 + /* "corels/_corels.pyx":262 * rules = NULL * n_rules = 0 * raise ValueError("Sample count mismatch between label (" + str(nsamples_chk) + # <<<<<<<<<<<<<< * ") and rule data (" + str(nsamples) + ")") * */ - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nsamples_chk); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 270, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nsamples_chk); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Sample_count_mismatch_between_la, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 270, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Sample_count_mismatch_between_la, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_t_5, __pyx_kp_u_and_rule_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_t_5, __pyx_kp_u_and_rule_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "corels/_corels.pyx":271 + /* "corels/_corels.pyx":263 * n_rules = 0 * raise ValueError("Sample count mismatch between label (" + str(nsamples_chk) + * ") and rule data (" + str(nsamples) + ")") # <<<<<<<<<<<<<< * * labels_vecs[0].features = malloc(8) */ - __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_nsamples); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_nsamples); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_t_6, __pyx_kp_u__3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_t_6, __pyx_kp_u__3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "corels/_corels.pyx":270 + /* "corels/_corels.pyx":262 * rules = NULL * n_rules = 0 * raise ValueError("Sample count mismatch between label (" + str(nsamples_chk) + # <<<<<<<<<<<<<< * ") and rule data (" + str(nsamples) + ")") * */ - __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 270, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 270, __pyx_L1_error) + __PYX_ERR(0, 262, __pyx_L1_error) - /* "corels/_corels.pyx":262 + /* "corels/_corels.pyx":254 * raise * * if nsamples_chk != nsamples: # <<<<<<<<<<<<<< @@ -4551,7 +4527,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":273 + /* "corels/_corels.pyx":265 * ") and rule data (" + str(nsamples) + ")") * * labels_vecs[0].features = malloc(8) # <<<<<<<<<<<<<< @@ -4560,7 +4536,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ (__pyx_v_6corels_7_corels_labels_vecs[0]).features = ((char *)malloc(8)); - /* "corels/_corels.pyx":274 + /* "corels/_corels.pyx":266 * * labels_vecs[0].features = malloc(8) * labels_vecs[1].features = malloc(8) # <<<<<<<<<<<<<< @@ -4569,25 +4545,25 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ (__pyx_v_6corels_7_corels_labels_vecs[1]).features = ((char *)malloc(8)); - /* "corels/_corels.pyx":275 + /* "corels/_corels.pyx":267 * labels_vecs[0].features = malloc(8) * labels_vecs[1].features = malloc(8) * if labels_vecs[0].features == NULL or labels_vecs[1].features == NULL: # <<<<<<<<<<<<<< * if labels_vecs != NULL: * _free_vector(labels_vecs, 2) */ - __pyx_t_13 = (((__pyx_v_6corels_7_corels_labels_vecs[0]).features == NULL) != 0); - if (!__pyx_t_13) { + __pyx_t_14 = (((__pyx_v_6corels_7_corels_labels_vecs[0]).features == NULL) != 0); + if (!__pyx_t_14) { } else { - __pyx_t_3 = __pyx_t_13; + __pyx_t_3 = __pyx_t_14; goto __pyx_L34_bool_binop_done; } - __pyx_t_13 = (((__pyx_v_6corels_7_corels_labels_vecs[1]).features == NULL) != 0); - __pyx_t_3 = __pyx_t_13; + __pyx_t_14 = (((__pyx_v_6corels_7_corels_labels_vecs[1]).features == NULL) != 0); + __pyx_t_3 = __pyx_t_14; __pyx_L34_bool_binop_done:; if (__pyx_t_3) { - /* "corels/_corels.pyx":276 + /* "corels/_corels.pyx":268 * labels_vecs[1].features = malloc(8) * if labels_vecs[0].features == NULL or labels_vecs[1].features == NULL: * if labels_vecs != NULL: # <<<<<<<<<<<<<< @@ -4597,18 +4573,18 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = ((__pyx_v_6corels_7_corels_labels_vecs != NULL) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":277 + /* "corels/_corels.pyx":269 * if labels_vecs[0].features == NULL or labels_vecs[1].features == NULL: * if labels_vecs != NULL: * _free_vector(labels_vecs, 2) # <<<<<<<<<<<<<< * labels_vecs = NULL * if rules != NULL: */ - __pyx_t_6 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_labels_vecs, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 277, __pyx_L1_error) + __pyx_t_6 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_labels_vecs, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "corels/_corels.pyx":278 + /* "corels/_corels.pyx":270 * if labels_vecs != NULL: * _free_vector(labels_vecs, 2) * labels_vecs = NULL # <<<<<<<<<<<<<< @@ -4617,7 +4593,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_6corels_7_corels_labels_vecs = NULL; - /* "corels/_corels.pyx":276 + /* "corels/_corels.pyx":268 * labels_vecs[1].features = malloc(8) * if labels_vecs[0].features == NULL or labels_vecs[1].features == NULL: * if labels_vecs != NULL: # <<<<<<<<<<<<<< @@ -4626,7 +4602,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":279 + /* "corels/_corels.pyx":271 * _free_vector(labels_vecs, 2) * labels_vecs = NULL * if rules != NULL: # <<<<<<<<<<<<<< @@ -4636,18 +4612,18 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = ((__pyx_v_6corels_7_corels_rules != NULL) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":280 + /* "corels/_corels.pyx":272 * labels_vecs = NULL * if rules != NULL: * _free_vector(rules, n_rules) # <<<<<<<<<<<<<< * rules = NULL * n_rules = 0 */ - __pyx_t_6 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_rules, __pyx_v_6corels_7_corels_n_rules); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 280, __pyx_L1_error) + __pyx_t_6 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_rules, __pyx_v_6corels_7_corels_n_rules); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "corels/_corels.pyx":281 + /* "corels/_corels.pyx":273 * if rules != NULL: * _free_vector(rules, n_rules) * rules = NULL # <<<<<<<<<<<<<< @@ -4656,7 +4632,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_6corels_7_corels_rules = NULL; - /* "corels/_corels.pyx":279 + /* "corels/_corels.pyx":271 * _free_vector(labels_vecs, 2) * labels_vecs = NULL * if rules != NULL: # <<<<<<<<<<<<<< @@ -4665,7 +4641,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":282 + /* "corels/_corels.pyx":274 * _free_vector(rules, n_rules) * rules = NULL * n_rules = 0 # <<<<<<<<<<<<<< @@ -4674,16 +4650,16 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_6corels_7_corels_n_rules = 0; - /* "corels/_corels.pyx":283 + /* "corels/_corels.pyx":275 * rules = NULL * n_rules = 0 * raise MemoryError(); # <<<<<<<<<<<<<< * strcpy(labels_vecs[0].features, "label=0") * strcpy(labels_vecs[1].features, "label=1") */ - PyErr_NoMemory(); __PYX_ERR(0, 283, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(0, 275, __pyx_L1_error) - /* "corels/_corels.pyx":275 + /* "corels/_corels.pyx":267 * labels_vecs[0].features = malloc(8) * labels_vecs[1].features = malloc(8) * if labels_vecs[0].features == NULL or labels_vecs[1].features == NULL: # <<<<<<<<<<<<<< @@ -4692,7 +4668,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":284 + /* "corels/_corels.pyx":276 * n_rules = 0 * raise MemoryError(); * strcpy(labels_vecs[0].features, "label=0") # <<<<<<<<<<<<<< @@ -4701,7 +4677,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ (void)(strcpy((__pyx_v_6corels_7_corels_labels_vecs[0]).features, ((char const *)"label=0"))); - /* "corels/_corels.pyx":285 + /* "corels/_corels.pyx":277 * raise MemoryError(); * strcpy(labels_vecs[0].features, "label=0") * strcpy(labels_vecs[1].features, "label=1") # <<<<<<<<<<<<<< @@ -4710,7 +4686,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ (void)(strcpy((__pyx_v_6corels_7_corels_labels_vecs[1]).features, ((char const *)"label=1"))); - /* "corels/_corels.pyx":287 + /* "corels/_corels.pyx":279 * strcpy(labels_vecs[1].features, "label=1") * * if minor != NULL: # <<<<<<<<<<<<<< @@ -4720,18 +4696,18 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = ((__pyx_v_6corels_7_corels_minor != NULL) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":288 + /* "corels/_corels.pyx":280 * * if minor != NULL: * _free_vector(minor, 1) # <<<<<<<<<<<<<< * minor = NULL * */ - __pyx_t_6 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_minor, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error) + __pyx_t_6 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_minor, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "corels/_corels.pyx":289 + /* "corels/_corels.pyx":281 * if minor != NULL: * _free_vector(minor, 1) * minor = NULL # <<<<<<<<<<<<<< @@ -4740,7 +4716,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_6corels_7_corels_minor = NULL; - /* "corels/_corels.pyx":287 + /* "corels/_corels.pyx":279 * strcpy(labels_vecs[1].features, "label=1") * * if minor != NULL: # <<<<<<<<<<<<<< @@ -4749,7 +4725,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":291 + /* "corels/_corels.pyx":283 * minor = NULL * * minor = malloc(sizeof(rule_t)) # <<<<<<<<<<<<<< @@ -4758,7 +4734,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_6corels_7_corels_minor = ((rule_t *)malloc((sizeof(rule_t)))); - /* "corels/_corels.pyx":292 + /* "corels/_corels.pyx":284 * * minor = malloc(sizeof(rule_t)) * if minor == NULL: # <<<<<<<<<<<<<< @@ -4768,7 +4744,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = ((__pyx_v_6corels_7_corels_minor == NULL) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":293 + /* "corels/_corels.pyx":285 * minor = malloc(sizeof(rule_t)) * if minor == NULL: * if labels_vecs != NULL: # <<<<<<<<<<<<<< @@ -4778,18 +4754,18 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = ((__pyx_v_6corels_7_corels_labels_vecs != NULL) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":294 + /* "corels/_corels.pyx":286 * if minor == NULL: * if labels_vecs != NULL: * _free_vector(labels_vecs, 2) # <<<<<<<<<<<<<< * labels_vecs = NULL * if rules != NULL: */ - __pyx_t_6 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_labels_vecs, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 294, __pyx_L1_error) + __pyx_t_6 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_labels_vecs, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "corels/_corels.pyx":295 + /* "corels/_corels.pyx":287 * if labels_vecs != NULL: * _free_vector(labels_vecs, 2) * labels_vecs = NULL # <<<<<<<<<<<<<< @@ -4798,7 +4774,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_6corels_7_corels_labels_vecs = NULL; - /* "corels/_corels.pyx":293 + /* "corels/_corels.pyx":285 * minor = malloc(sizeof(rule_t)) * if minor == NULL: * if labels_vecs != NULL: # <<<<<<<<<<<<<< @@ -4807,7 +4783,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":296 + /* "corels/_corels.pyx":288 * _free_vector(labels_vecs, 2) * labels_vecs = NULL * if rules != NULL: # <<<<<<<<<<<<<< @@ -4817,18 +4793,18 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = ((__pyx_v_6corels_7_corels_rules != NULL) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":297 + /* "corels/_corels.pyx":289 * labels_vecs = NULL * if rules != NULL: * _free_vector(rules, n_rules) # <<<<<<<<<<<<<< * rules = NULL * n_rules = 0 */ - __pyx_t_6 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_rules, __pyx_v_6corels_7_corels_n_rules); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_6 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_rules, __pyx_v_6corels_7_corels_n_rules); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "corels/_corels.pyx":298 + /* "corels/_corels.pyx":290 * if rules != NULL: * _free_vector(rules, n_rules) * rules = NULL # <<<<<<<<<<<<<< @@ -4837,7 +4813,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_6corels_7_corels_rules = NULL; - /* "corels/_corels.pyx":296 + /* "corels/_corels.pyx":288 * _free_vector(labels_vecs, 2) * labels_vecs = NULL * if rules != NULL: # <<<<<<<<<<<<<< @@ -4846,7 +4822,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":299 + /* "corels/_corels.pyx":291 * _free_vector(rules, n_rules) * rules = NULL * n_rules = 0 # <<<<<<<<<<<<<< @@ -4855,16 +4831,16 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_6corels_7_corels_n_rules = 0; - /* "corels/_corels.pyx":300 + /* "corels/_corels.pyx":292 * rules = NULL * n_rules = 0 * raise MemoryError(); # <<<<<<<<<<<<<< * - * cdef int mr = minority(rules, n_rules, labels_vecs, nsamples, minor, minor_verbose) + * cdef int minor_count = 0; */ - PyErr_NoMemory(); __PYX_ERR(0, 300, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(0, 292, __pyx_L1_error) - /* "corels/_corels.pyx":292 + /* "corels/_corels.pyx":284 * * minor = malloc(sizeof(rule_t)) * if minor == NULL: # <<<<<<<<<<<<<< @@ -4873,19 +4849,28 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":302 + /* "corels/_corels.pyx":294 * raise MemoryError(); * - * cdef int mr = minority(rules, n_rules, labels_vecs, nsamples, minor, minor_verbose) # <<<<<<<<<<<<<< + * cdef int minor_count = 0; # <<<<<<<<<<<<<< + * cdef int mr = minority(rules, n_rules, labels_vecs, nsamples, minor, minor_verbose, &minor_count) * if mr != 0: - * if labels_vecs != NULL: */ - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_nsamples); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 302, __pyx_L1_error) - __pyx_v_mr = minority(__pyx_v_6corels_7_corels_rules, __pyx_v_6corels_7_corels_n_rules, __pyx_v_6corels_7_corels_labels_vecs, __pyx_t_4, __pyx_v_6corels_7_corels_minor, __pyx_v_minor_verbose); + __pyx_v_minor_count = 0; - /* "corels/_corels.pyx":303 + /* "corels/_corels.pyx":295 * - * cdef int mr = minority(rules, n_rules, labels_vecs, nsamples, minor, minor_verbose) + * cdef int minor_count = 0; + * cdef int mr = minority(rules, n_rules, labels_vecs, nsamples, minor, minor_verbose, &minor_count) # <<<<<<<<<<<<<< + * if mr != 0: + * if labels_vecs != NULL: + */ + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_nsamples); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 295, __pyx_L1_error) + __pyx_v_mr = minority(__pyx_v_6corels_7_corels_rules, __pyx_v_6corels_7_corels_n_rules, __pyx_v_6corels_7_corels_labels_vecs, __pyx_t_4, __pyx_v_6corels_7_corels_minor, __pyx_v_minor_verbose, (&__pyx_v_minor_count)); + + /* "corels/_corels.pyx":296 + * cdef int minor_count = 0; + * cdef int mr = minority(rules, n_rules, labels_vecs, nsamples, minor, minor_verbose, &minor_count) * if mr != 0: # <<<<<<<<<<<<<< * if labels_vecs != NULL: * _free_vector(labels_vecs, 2) @@ -4893,8 +4878,8 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = ((__pyx_v_mr != 0) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":304 - * cdef int mr = minority(rules, n_rules, labels_vecs, nsamples, minor, minor_verbose) + /* "corels/_corels.pyx":297 + * cdef int mr = minority(rules, n_rules, labels_vecs, nsamples, minor, minor_verbose, &minor_count) * if mr != 0: * if labels_vecs != NULL: # <<<<<<<<<<<<<< * _free_vector(labels_vecs, 2) @@ -4903,18 +4888,18 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = ((__pyx_v_6corels_7_corels_labels_vecs != NULL) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":305 + /* "corels/_corels.pyx":298 * if mr != 0: * if labels_vecs != NULL: * _free_vector(labels_vecs, 2) # <<<<<<<<<<<<<< * labels_vecs = NULL * if rules != NULL: */ - __pyx_t_6 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_labels_vecs, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 305, __pyx_L1_error) + __pyx_t_6 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_labels_vecs, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "corels/_corels.pyx":306 + /* "corels/_corels.pyx":299 * if labels_vecs != NULL: * _free_vector(labels_vecs, 2) * labels_vecs = NULL # <<<<<<<<<<<<<< @@ -4923,8 +4908,8 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_6corels_7_corels_labels_vecs = NULL; - /* "corels/_corels.pyx":304 - * cdef int mr = minority(rules, n_rules, labels_vecs, nsamples, minor, minor_verbose) + /* "corels/_corels.pyx":297 + * cdef int mr = minority(rules, n_rules, labels_vecs, nsamples, minor, minor_verbose, &minor_count) * if mr != 0: * if labels_vecs != NULL: # <<<<<<<<<<<<<< * _free_vector(labels_vecs, 2) @@ -4932,7 +4917,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":307 + /* "corels/_corels.pyx":300 * _free_vector(labels_vecs, 2) * labels_vecs = NULL * if rules != NULL: # <<<<<<<<<<<<<< @@ -4942,18 +4927,18 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = ((__pyx_v_6corels_7_corels_rules != NULL) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":308 + /* "corels/_corels.pyx":301 * labels_vecs = NULL * if rules != NULL: * _free_vector(rules, n_rules) # <<<<<<<<<<<<<< * rules = NULL * n_rules = 0 */ - __pyx_t_6 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_rules, __pyx_v_6corels_7_corels_n_rules); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_t_6 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_rules, __pyx_v_6corels_7_corels_n_rules); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "corels/_corels.pyx":309 + /* "corels/_corels.pyx":302 * if rules != NULL: * _free_vector(rules, n_rules) * rules = NULL # <<<<<<<<<<<<<< @@ -4962,7 +4947,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_6corels_7_corels_rules = NULL; - /* "corels/_corels.pyx":307 + /* "corels/_corels.pyx":300 * _free_vector(labels_vecs, 2) * labels_vecs = NULL * if rules != NULL: # <<<<<<<<<<<<<< @@ -4971,536 +4956,164 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":310 + /* "corels/_corels.pyx":303 * _free_vector(rules, n_rules) * rules = NULL * n_rules = 0 # <<<<<<<<<<<<<< * raise MemoryError() * """ */ - __pyx_v_6corels_7_corels_n_rules = 0; - - /* "corels/_corels.pyx":311 - * rules = NULL - * n_rules = 0 - * raise MemoryError() # <<<<<<<<<<<<<< - * """ - * if count_ones_vector(minor[0].truthtable, nsamples) <= 0: - */ - PyErr_NoMemory(); __PYX_ERR(0, 311, __pyx_L1_error) - - /* "corels/_corels.pyx":303 - * - * cdef int mr = minority(rules, n_rules, labels_vecs, nsamples, minor, minor_verbose) - * if mr != 0: # <<<<<<<<<<<<<< - * if labels_vecs != NULL: - * _free_vector(labels_vecs, 2) - */ - } - - /* "corels/_corels.pyx":320 - * - * cdef int rb = run_corels_begin(c, verbosity, policy, map_type, ablation, calculate_size, - * n_rules, 2, nsamples, rules, labels_vecs, minor, 0, NULL, pmap, tree, # <<<<<<<<<<<<<< - * queue, init, run_verbosity) - * - */ - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_nsamples); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L1_error) - - /* "corels/_corels.pyx":319 - * """ - * - * cdef int rb = run_corels_begin(c, verbosity, policy, map_type, ablation, calculate_size, # <<<<<<<<<<<<<< - * n_rules, 2, nsamples, rules, labels_vecs, minor, 0, NULL, pmap, tree, - * queue, init, run_verbosity) - */ - __pyx_v_rb = run_corels_begin(__pyx_v_c, __pyx_v_verbosity, __pyx_v_policy, __pyx_v_map_type, __pyx_v_ablation, __pyx_v_calculate_size, __pyx_v_6corels_7_corels_n_rules, 2, __pyx_t_4, __pyx_v_6corels_7_corels_rules, __pyx_v_6corels_7_corels_labels_vecs, __pyx_v_6corels_7_corels_minor, 0, NULL, __pyx_v_6corels_7_corels_pmap, __pyx_v_6corels_7_corels_tree, __pyx_v_6corels_7_corels_queue, __pyx_v_6corels_7_corels_init, __pyx_v_6corels_7_corels_run_verbosity); - - /* "corels/_corels.pyx":323 - * queue, init, run_verbosity) - * - * if rb == -1: # <<<<<<<<<<<<<< - * if labels_vecs != NULL: - * _free_vector(labels_vecs, 2) - */ - __pyx_t_3 = ((__pyx_v_rb == -1L) != 0); - if (__pyx_t_3) { - - /* "corels/_corels.pyx":324 - * - * if rb == -1: - * if labels_vecs != NULL: # <<<<<<<<<<<<<< - * _free_vector(labels_vecs, 2) - * labels_vecs = NULL - */ - __pyx_t_3 = ((__pyx_v_6corels_7_corels_labels_vecs != NULL) != 0); - if (__pyx_t_3) { - - /* "corels/_corels.pyx":325 - * if rb == -1: - * if labels_vecs != NULL: - * _free_vector(labels_vecs, 2) # <<<<<<<<<<<<<< - * labels_vecs = NULL - * if minor != NULL: - */ - __pyx_t_6 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_labels_vecs, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 325, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - - /* "corels/_corels.pyx":326 - * if labels_vecs != NULL: - * _free_vector(labels_vecs, 2) - * labels_vecs = NULL # <<<<<<<<<<<<<< - * if minor != NULL: - * _free_vector(minor, 1) - */ - __pyx_v_6corels_7_corels_labels_vecs = NULL; - - /* "corels/_corels.pyx":324 - * - * if rb == -1: - * if labels_vecs != NULL: # <<<<<<<<<<<<<< - * _free_vector(labels_vecs, 2) - * labels_vecs = NULL - */ - } - - /* "corels/_corels.pyx":327 - * _free_vector(labels_vecs, 2) - * labels_vecs = NULL - * if minor != NULL: # <<<<<<<<<<<<<< - * _free_vector(minor, 1) - * minor = NULL - */ - __pyx_t_3 = ((__pyx_v_6corels_7_corels_minor != NULL) != 0); - if (__pyx_t_3) { - - /* "corels/_corels.pyx":328 - * labels_vecs = NULL - * if minor != NULL: - * _free_vector(minor, 1) # <<<<<<<<<<<<<< - * minor = NULL - * if rules != NULL: - */ - __pyx_t_6 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_minor, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 328, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - - /* "corels/_corels.pyx":329 - * if minor != NULL: - * _free_vector(minor, 1) - * minor = NULL # <<<<<<<<<<<<<< - * if rules != NULL: - * _free_vector(rules, n_rules) - */ - __pyx_v_6corels_7_corels_minor = NULL; - - /* "corels/_corels.pyx":327 - * _free_vector(labels_vecs, 2) - * labels_vecs = NULL - * if minor != NULL: # <<<<<<<<<<<<<< - * _free_vector(minor, 1) - * minor = NULL - */ - } - - /* "corels/_corels.pyx":330 - * _free_vector(minor, 1) - * minor = NULL - * if rules != NULL: # <<<<<<<<<<<<<< - * _free_vector(rules, n_rules) - * rules = NULL - */ - __pyx_t_3 = ((__pyx_v_6corels_7_corels_rules != NULL) != 0); - if (__pyx_t_3) { - - /* "corels/_corels.pyx":331 - * minor = NULL - * if rules != NULL: - * _free_vector(rules, n_rules) # <<<<<<<<<<<<<< - * rules = NULL - * n_rules = 0 - */ - __pyx_t_6 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_rules, __pyx_v_6corels_7_corels_n_rules); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 331, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - - /* "corels/_corels.pyx":332 - * if rules != NULL: - * _free_vector(rules, n_rules) - * rules = NULL # <<<<<<<<<<<<<< - * n_rules = 0 - * - */ - __pyx_v_6corels_7_corels_rules = NULL; - - /* "corels/_corels.pyx":330 - * _free_vector(minor, 1) - * minor = NULL - * if rules != NULL: # <<<<<<<<<<<<<< - * _free_vector(rules, n_rules) - * rules = NULL - */ - } - - /* "corels/_corels.pyx":333 - * _free_vector(rules, n_rules) - * rules = NULL - * n_rules = 0 # <<<<<<<<<<<<<< - * - * return False - */ - __pyx_v_6corels_7_corels_n_rules = 0; - - /* "corels/_corels.pyx":335 - * n_rules = 0 - * - * return False # <<<<<<<<<<<<<< - * - * return True - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - goto __pyx_L0; - - /* "corels/_corels.pyx":323 - * queue, init, run_verbosity) - * - * if rb == -1: # <<<<<<<<<<<<<< - * if labels_vecs != NULL: - * _free_vector(labels_vecs, 2) - */ - } - - /* "corels/_corels.pyx":337 - * return False - * - * return True # <<<<<<<<<<<<<< - * - * def fit_wrap_loop(size_t max_nodes): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_True); - __pyx_r = Py_True; - goto __pyx_L0; - - /* "corels/_corels.pyx":179 - * cdef set[string] run_verbosity - * - * def fit_wrap_begin(np.ndarray[np.uint8_t, ndim=2] samples, # <<<<<<<<<<<<<< - * np.ndarray[np.uint8_t, ndim=2] labels, - * features, int max_card, double min_support, verbosity_str, int mine_verbose, - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_samples.rcbuffer->pybuffer); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("corels._corels.fit_wrap_begin", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - goto __pyx_L2; - __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_samples.rcbuffer->pybuffer); - __pyx_L2:; - __Pyx_XDECREF(__pyx_v_nsamples); - __Pyx_XDECREF(__pyx_v_bytestr); - __Pyx_XDECREF(__pyx_v_verbosity_ascii); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "corels/_corels.pyx":339 - * return True - * - * def fit_wrap_loop(size_t max_nodes): # <<<<<<<<<<<<<< - * cdef size_t max_num_nodes = max_nodes - * # This is where the magic happens - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_6corels_7_corels_5fit_wrap_loop(PyObject *__pyx_self, PyObject *__pyx_arg_max_nodes); /*proto*/ -static PyMethodDef __pyx_mdef_6corels_7_corels_5fit_wrap_loop = {"fit_wrap_loop", (PyCFunction)__pyx_pw_6corels_7_corels_5fit_wrap_loop, METH_O, 0}; -static PyObject *__pyx_pw_6corels_7_corels_5fit_wrap_loop(PyObject *__pyx_self, PyObject *__pyx_arg_max_nodes) { - size_t __pyx_v_max_nodes; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("fit_wrap_loop (wrapper)", 0); - assert(__pyx_arg_max_nodes); { - __pyx_v_max_nodes = __Pyx_PyInt_As_size_t(__pyx_arg_max_nodes); if (unlikely((__pyx_v_max_nodes == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error) - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - __Pyx_AddTraceback("corels._corels.fit_wrap_loop", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6corels_7_corels_4fit_wrap_loop(__pyx_self, ((size_t)__pyx_v_max_nodes)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_6corels_7_corels_4fit_wrap_loop(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_max_nodes) { - size_t __pyx_v_max_num_nodes; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("fit_wrap_loop", 0); - - /* "corels/_corels.pyx":340 - * - * def fit_wrap_loop(size_t max_nodes): - * cdef size_t max_num_nodes = max_nodes # <<<<<<<<<<<<<< - * # This is where the magic happens - * return (run_corels_loop(max_num_nodes, pmap, tree, queue) != -1) - */ - __pyx_v_max_num_nodes = __pyx_v_max_nodes; - - /* "corels/_corels.pyx":342 - * cdef size_t max_num_nodes = max_nodes - * # This is where the magic happens - * return (run_corels_loop(max_num_nodes, pmap, tree, queue) != -1) # <<<<<<<<<<<<<< - * - * def fit_wrap_end(int early): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyBool_FromLong((run_corels_loop(__pyx_v_max_num_nodes, __pyx_v_6corels_7_corels_pmap, __pyx_v_6corels_7_corels_tree, __pyx_v_6corels_7_corels_queue) != -1L)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "corels/_corels.pyx":339 - * return True - * - * def fit_wrap_loop(size_t max_nodes): # <<<<<<<<<<<<<< - * cdef size_t max_num_nodes = max_nodes - * # This is where the magic happens - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("corels._corels.fit_wrap_loop", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "corels/_corels.pyx":344 - * return (run_corels_loop(max_num_nodes, pmap, tree, queue) != -1) - * - * def fit_wrap_end(int early): # <<<<<<<<<<<<<< - * global rules - * global labels_vecs - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_6corels_7_corels_7fit_wrap_end(PyObject *__pyx_self, PyObject *__pyx_arg_early); /*proto*/ -static PyMethodDef __pyx_mdef_6corels_7_corels_7fit_wrap_end = {"fit_wrap_end", (PyCFunction)__pyx_pw_6corels_7_corels_7fit_wrap_end, METH_O, 0}; -static PyObject *__pyx_pw_6corels_7_corels_7fit_wrap_end(PyObject *__pyx_self, PyObject *__pyx_arg_early) { - int __pyx_v_early; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("fit_wrap_end (wrapper)", 0); - assert(__pyx_arg_early); { - __pyx_v_early = __Pyx_PyInt_As_int(__pyx_arg_early); if (unlikely((__pyx_v_early == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 344, __pyx_L3_error) - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - __Pyx_AddTraceback("corels._corels.fit_wrap_end", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6corels_7_corels_6fit_wrap_end(__pyx_self, ((int)__pyx_v_early)); + __pyx_v_6corels_7_corels_n_rules = 0; - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "corels/_corels.pyx":304 + * rules = NULL + * n_rules = 0 + * raise MemoryError() # <<<<<<<<<<<<<< + * """ + * if count_ones_vector(minor[0].truthtable, nsamples) <= 0: + */ + PyErr_NoMemory(); __PYX_ERR(0, 304, __pyx_L1_error) -static PyObject *__pyx_pf_6corels_7_corels_6fit_wrap_end(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_early) { - std::vector __pyx_v_rulelist; - std::vector __pyx_v_classes; - PyObject *__pyx_v_r_out = NULL; - std::vector ::size_type __pyx_v_i; - int __pyx_v_j; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - std::vector ::size_type __pyx_t_3; - std::vector ::size_type __pyx_t_4; - std::vector ::size_type __pyx_t_5; - int __pyx_t_6; - int __pyx_t_7; - int __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("fit_wrap_end", 0); + /* "corels/_corels.pyx":296 + * cdef int minor_count = 0; + * cdef int mr = minority(rules, n_rules, labels_vecs, nsamples, minor, minor_verbose, &minor_count) + * if mr != 0: # <<<<<<<<<<<<<< + * if labels_vecs != NULL: + * _free_vector(labels_vecs, 2) + */ + } - /* "corels/_corels.pyx":352 - * cdef vector[int] rulelist - * cdef vector[int] classes - * run_corels_end(&rulelist, &classes, early, 0, NULL, NULL, NULL, pmap, tree, # <<<<<<<<<<<<<< - * queue, init, run_verbosity) + /* "corels/_corels.pyx":315 * + * cdef double rb = run_corels(c, verbosity, policy, map_type, ablation, calculate_size, + * n_rules, 2, nsamples, rules, labels_vecs, minor, 1000, NULL, pmap, tree, # <<<<<<<<<<<<<< + * queue, init, 10, num_threads, max_num_nodes, minor_count, 262, + * &rulelist, &classes) */ - (void)(run_corels_end((&__pyx_v_rulelist), (&__pyx_v_classes), __pyx_v_early, 0, NULL, NULL, NULL, __pyx_v_6corels_7_corels_pmap, __pyx_v_6corels_7_corels_tree, __pyx_v_6corels_7_corels_queue, __pyx_v_6corels_7_corels_init, __pyx_v_6corels_7_corels_run_verbosity)); + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_nsamples); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 315, __pyx_L1_error) - /* "corels/_corels.pyx":355 - * queue, init, run_verbosity) + /* "corels/_corels.pyx":314 + * cdef vector[int] classes * - * r_out = [] # <<<<<<<<<<<<<< - * print(rulelist.size()) - * for i in range(rulelist.size()): + * cdef double rb = run_corels(c, verbosity, policy, map_type, ablation, calculate_size, # <<<<<<<<<<<<<< + * n_rules, 2, nsamples, rules, labels_vecs, minor, 1000, NULL, pmap, tree, + * queue, init, 10, num_threads, max_num_nodes, minor_count, 262, */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 355, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_r_out = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; + __pyx_v_rb = run_corels(__pyx_v_c, __pyx_v_verbosity, __pyx_v_policy, __pyx_v_map_type, __pyx_v_ablation, __pyx_v_calculate_size, __pyx_v_6corels_7_corels_n_rules, 2, __pyx_t_4, __pyx_v_6corels_7_corels_rules, __pyx_v_6corels_7_corels_labels_vecs, __pyx_v_6corels_7_corels_minor, 0x3E8, NULL, __pyx_v_6corels_7_corels_pmap, __pyx_v_6corels_7_corels_tree, __pyx_v_6corels_7_corels_queue, __pyx_v_6corels_7_corels_init, 10, __pyx_v_num_threads, __pyx_v_max_num_nodes, __pyx_v_minor_count, 0x106, (&__pyx_v_rulelist), (&__pyx_v_classes)); - /* "corels/_corels.pyx":356 + /* "corels/_corels.pyx":319 + * &rulelist, &classes) * - * r_out = [] - * print(rulelist.size()) # <<<<<<<<<<<<<< + * r_out = [] # <<<<<<<<<<<<<< * for i in range(rulelist.size()): * if rulelist[i] < n_rules: */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_rulelist.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __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_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 319, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_r_out = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; - /* "corels/_corels.pyx":357 + /* "corels/_corels.pyx":320 + * * r_out = [] - * print(rulelist.size()) * for i in range(rulelist.size()): # <<<<<<<<<<<<<< * if rulelist[i] < n_rules: * r_out.append({}) */ - __pyx_t_3 = __pyx_v_rulelist.size(); - __pyx_t_4 = __pyx_t_3; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { - __pyx_v_i = __pyx_t_5; + __pyx_t_8 = __pyx_v_rulelist.size(); + __pyx_t_10 = __pyx_t_8; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; - /* "corels/_corels.pyx":358 - * print(rulelist.size()) + /* "corels/_corels.pyx":321 + * r_out = [] * for i in range(rulelist.size()): * if rulelist[i] < n_rules: # <<<<<<<<<<<<<< * r_out.append({}) * r_out[i]["antecedents"] = [] */ - __pyx_t_6 = (((__pyx_v_rulelist[__pyx_v_i]) < __pyx_v_6corels_7_corels_n_rules) != 0); - if (__pyx_t_6) { + __pyx_t_3 = (((__pyx_v_rulelist[__pyx_v_i]) < __pyx_v_6corels_7_corels_n_rules) != 0); + if (__pyx_t_3) { - /* "corels/_corels.pyx":359 + /* "corels/_corels.pyx":322 * for i in range(rulelist.size()): * if rulelist[i] < n_rules: * r_out.append({}) # <<<<<<<<<<<<<< * r_out[i]["antecedents"] = [] * for j in range(rules[rulelist[i]].cardinality): */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 359, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_r_out, __pyx_t_2); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 359, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 322, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_19 = __Pyx_PyList_Append(__pyx_v_r_out, __pyx_t_6); if (unlikely(__pyx_t_19 == ((int)-1))) __PYX_ERR(0, 322, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "corels/_corels.pyx":360 + /* "corels/_corels.pyx":323 * if rulelist[i] < n_rules: * r_out.append({}) * r_out[i]["antecedents"] = [] # <<<<<<<<<<<<<< * for j in range(rules[rulelist[i]].cardinality): * r_out[i]["antecedents"].append(rules[rulelist[i]].ids[j]) */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 360, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_r_out, __pyx_v_i, std::vector ::size_type, 0, __Pyx_PyInt_FromSize_t, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_n_u_antecedents, __pyx_t_2) < 0)) __PYX_ERR(0, 360, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 323, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_r_out, __pyx_v_i, std::vector ::size_type, 0, __Pyx_PyInt_FromSize_t, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 323, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_n_u_antecedents, __pyx_t_6) < 0)) __PYX_ERR(0, 323, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "corels/_corels.pyx":361 + /* "corels/_corels.pyx":324 * r_out.append({}) * r_out[i]["antecedents"] = [] * for j in range(rules[rulelist[i]].cardinality): # <<<<<<<<<<<<<< * r_out[i]["antecedents"].append(rules[rulelist[i]].ids[j]) * */ - __pyx_t_8 = (__pyx_v_6corels_7_corels_rules[(__pyx_v_rulelist[__pyx_v_i])]).cardinality; - __pyx_t_9 = __pyx_t_8; - for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { - __pyx_v_j = __pyx_t_10; + __pyx_t_4 = (__pyx_v_6corels_7_corels_rules[(__pyx_v_rulelist[__pyx_v_i])]).cardinality; + __pyx_t_7 = __pyx_t_4; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_7; __pyx_t_12+=1) { + __pyx_v_j = __pyx_t_12; - /* "corels/_corels.pyx":362 + /* "corels/_corels.pyx":325 * r_out[i]["antecedents"] = [] * for j in range(rules[rulelist[i]].cardinality): * r_out[i]["antecedents"].append(rules[rulelist[i]].ids[j]) # <<<<<<<<<<<<<< * * r_out[i]["prediction"] = bool(classes[i]) */ - __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_r_out, __pyx_v_i, std::vector ::size_type, 0, __Pyx_PyInt_FromSize_t, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_antecedents); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_int(((__pyx_v_6corels_7_corels_rules[(__pyx_v_rulelist[__pyx_v_i])]).ids[__pyx_v_j])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_2); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 362, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_r_out, __pyx_v_i, std::vector ::size_type, 0, __Pyx_PyInt_FromSize_t, 1, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_t_6, __pyx_n_u_antecedents); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_6corels_7_corels_rules[(__pyx_v_rulelist[__pyx_v_i])]).ids[__pyx_v_j])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_19 = __Pyx_PyObject_Append(__pyx_t_5, __pyx_t_6); if (unlikely(__pyx_t_19 == ((int)-1))) __PYX_ERR(0, 325, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - /* "corels/_corels.pyx":364 + /* "corels/_corels.pyx":327 * r_out[i]["antecedents"].append(rules[rulelist[i]].ids[j]) * * r_out[i]["prediction"] = bool(classes[i]) # <<<<<<<<<<<<<< * * r_out.append({ "antecedents": [0], "prediction": bool(classes[rulelist.size()]) }) */ - __pyx_t_2 = __Pyx_PyInt_From_int((__pyx_v_classes[__pyx_v_i])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 364, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 364, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 364, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_r_out, __pyx_v_i, std::vector ::size_type, 0, __Pyx_PyInt_FromSize_t, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_n_u_prediction, __pyx_t_2) < 0)) __PYX_ERR(0, 364, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_classes[__pyx_v_i])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 327, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 327, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyBool_FromLong((!(!__pyx_t_3))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 327, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_r_out, __pyx_v_i, std::vector ::size_type, 0, __Pyx_PyInt_FromSize_t, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 327, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_n_u_prediction, __pyx_t_6) < 0)) __PYX_ERR(0, 327, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "corels/_corels.pyx":358 - * print(rulelist.size()) + /* "corels/_corels.pyx":321 + * r_out = [] * for i in range(rulelist.size()): * if rulelist[i] < n_rules: # <<<<<<<<<<<<<< * r_out.append({}) @@ -5509,203 +5122,232 @@ static PyObject *__pyx_pf_6corels_7_corels_6fit_wrap_end(CYTHON_UNUSED PyObject } } - /* "corels/_corels.pyx":366 + /* "corels/_corels.pyx":329 * r_out[i]["prediction"] = bool(classes[i]) * * r_out.append({ "antecedents": [0], "prediction": bool(classes[rulelist.size()]) }) # <<<<<<<<<<<<<< * - * # Exiting early skips cleanup + * if rb == -1: */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 366, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_0); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_antecedents, __pyx_t_1) < 0) __PYX_ERR(0, 366, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_classes[__pyx_v_rulelist.size()])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 366, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_prediction, __pyx_t_1) < 0) __PYX_ERR(0, 366, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_r_out, __pyx_t_2); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 366, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyList_SET_ITEM(__pyx_t_5, 0, __pyx_int_0); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_antecedents, __pyx_t_5) < 0) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyInt_From_int((__pyx_v_classes[__pyx_v_rulelist.size()])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyBool_FromLong((!(!__pyx_t_3))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_prediction, __pyx_t_5) < 0) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_19 = __Pyx_PyList_Append(__pyx_v_r_out, __pyx_t_6); if (unlikely(__pyx_t_19 == ((int)-1))) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "corels/_corels.pyx":369 + /* "corels/_corels.pyx":331 + * r_out.append({ "antecedents": [0], "prediction": bool(classes[rulelist.size()]) }) * - * # Exiting early skips cleanup - * if early == 0: # <<<<<<<<<<<<<< + * if rb == -1: # <<<<<<<<<<<<<< * if labels_vecs != NULL: * _free_vector(labels_vecs, 2) */ - __pyx_t_6 = ((__pyx_v_early == 0) != 0); - if (__pyx_t_6) { + __pyx_t_3 = ((__pyx_v_rb == -1.0) != 0); + if (__pyx_t_3) { - /* "corels/_corels.pyx":370 - * # Exiting early skips cleanup - * if early == 0: + /* "corels/_corels.pyx":332 + * + * if rb == -1: * if labels_vecs != NULL: # <<<<<<<<<<<<<< * _free_vector(labels_vecs, 2) - * if minor != NULL: + * labels_vecs = NULL */ - __pyx_t_6 = ((__pyx_v_6corels_7_corels_labels_vecs != NULL) != 0); - if (__pyx_t_6) { + __pyx_t_3 = ((__pyx_v_6corels_7_corels_labels_vecs != NULL) != 0); + if (__pyx_t_3) { - /* "corels/_corels.pyx":371 - * if early == 0: + /* "corels/_corels.pyx":333 + * if rb == -1: * if labels_vecs != NULL: * _free_vector(labels_vecs, 2) # <<<<<<<<<<<<<< + * labels_vecs = NULL + * if minor != NULL: + */ + __pyx_t_6 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_labels_vecs, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 333, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "corels/_corels.pyx":334 + * if labels_vecs != NULL: + * _free_vector(labels_vecs, 2) + * labels_vecs = NULL # <<<<<<<<<<<<<< * if minor != NULL: * _free_vector(minor, 1) */ - __pyx_t_2 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_labels_vecs, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 371, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_6corels_7_corels_labels_vecs = NULL; - /* "corels/_corels.pyx":370 - * # Exiting early skips cleanup - * if early == 0: + /* "corels/_corels.pyx":332 + * + * if rb == -1: * if labels_vecs != NULL: # <<<<<<<<<<<<<< * _free_vector(labels_vecs, 2) - * if minor != NULL: + * labels_vecs = NULL */ } - /* "corels/_corels.pyx":372 - * if labels_vecs != NULL: + /* "corels/_corels.pyx":335 * _free_vector(labels_vecs, 2) + * labels_vecs = NULL * if minor != NULL: # <<<<<<<<<<<<<< * _free_vector(minor, 1) - * if rules != NULL: + * minor = NULL */ - __pyx_t_6 = ((__pyx_v_6corels_7_corels_minor != NULL) != 0); - if (__pyx_t_6) { + __pyx_t_3 = ((__pyx_v_6corels_7_corels_minor != NULL) != 0); + if (__pyx_t_3) { - /* "corels/_corels.pyx":373 - * _free_vector(labels_vecs, 2) + /* "corels/_corels.pyx":336 + * labels_vecs = NULL * if minor != NULL: * _free_vector(minor, 1) # <<<<<<<<<<<<<< + * minor = NULL + * if rules != NULL: + */ + __pyx_t_6 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_minor, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "corels/_corels.pyx":337 + * if minor != NULL: + * _free_vector(minor, 1) + * minor = NULL # <<<<<<<<<<<<<< * if rules != NULL: * _free_vector(rules, n_rules) */ - __pyx_t_2 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_minor, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 373, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_6corels_7_corels_minor = NULL; - /* "corels/_corels.pyx":372 - * if labels_vecs != NULL: + /* "corels/_corels.pyx":335 * _free_vector(labels_vecs, 2) + * labels_vecs = NULL * if minor != NULL: # <<<<<<<<<<<<<< * _free_vector(minor, 1) - * if rules != NULL: + * minor = NULL */ } - /* "corels/_corels.pyx":374 - * if minor != NULL: + /* "corels/_corels.pyx":338 * _free_vector(minor, 1) + * minor = NULL * if rules != NULL: # <<<<<<<<<<<<<< * _free_vector(rules, n_rules) - * + * rules = NULL */ - __pyx_t_6 = ((__pyx_v_6corels_7_corels_rules != NULL) != 0); - if (__pyx_t_6) { + __pyx_t_3 = ((__pyx_v_6corels_7_corels_rules != NULL) != 0); + if (__pyx_t_3) { - /* "corels/_corels.pyx":375 - * _free_vector(minor, 1) + /* "corels/_corels.pyx":339 + * minor = NULL * if rules != NULL: * _free_vector(rules, n_rules) # <<<<<<<<<<<<<< + * rules = NULL + * n_rules = 0 + */ + __pyx_t_6 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_rules, __pyx_v_6corels_7_corels_n_rules); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "corels/_corels.pyx":340 + * if rules != NULL: + * _free_vector(rules, n_rules) + * rules = NULL # <<<<<<<<<<<<<< + * n_rules = 0 * - * minor = NULL */ - __pyx_t_2 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_rules, __pyx_v_6corels_7_corels_n_rules); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 375, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_6corels_7_corels_rules = NULL; - /* "corels/_corels.pyx":374 - * if minor != NULL: + /* "corels/_corels.pyx":338 * _free_vector(minor, 1) + * minor = NULL * if rules != NULL: # <<<<<<<<<<<<<< * _free_vector(rules, n_rules) - * + * rules = NULL */ } - /* "corels/_corels.pyx":369 - * - * # Exiting early skips cleanup - * if early == 0: # <<<<<<<<<<<<<< - * if labels_vecs != NULL: - * _free_vector(labels_vecs, 2) - */ - } - - /* "corels/_corels.pyx":377 + /* "corels/_corels.pyx":341 * _free_vector(rules, n_rules) + * rules = NULL + * n_rules = 0 # <<<<<<<<<<<<<< * - * minor = NULL # <<<<<<<<<<<<<< - * rules = NULL - * labels_vecs = NULL + * return Exception */ - __pyx_v_6corels_7_corels_minor = NULL; + __pyx_v_6corels_7_corels_n_rules = 0; - /* "corels/_corels.pyx":378 + /* "corels/_corels.pyx":343 + * n_rules = 0 * - * minor = NULL - * rules = NULL # <<<<<<<<<<<<<< - * labels_vecs = NULL - * n_rules = 0 - */ - __pyx_v_6corels_7_corels_rules = NULL; - - /* "corels/_corels.pyx":379 - * minor = NULL - * rules = NULL - * labels_vecs = NULL # <<<<<<<<<<<<<< - * n_rules = 0 + * return Exception # <<<<<<<<<<<<<< * + * return r_out */ - __pyx_v_6corels_7_corels_labels_vecs = NULL; + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + __pyx_r = ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])); + goto __pyx_L0; - /* "corels/_corels.pyx":380 - * rules = NULL - * labels_vecs = NULL - * n_rules = 0 # <<<<<<<<<<<<<< + /* "corels/_corels.pyx":331 + * r_out.append({ "antecedents": [0], "prediction": bool(classes[rulelist.size()]) }) * - * return r_out + * if rb == -1: # <<<<<<<<<<<<<< + * if labels_vecs != NULL: + * _free_vector(labels_vecs, 2) */ - __pyx_v_6corels_7_corels_n_rules = 0; + } - /* "corels/_corels.pyx":382 - * n_rules = 0 + /* "corels/_corels.pyx":345 + * return Exception * * return r_out # <<<<<<<<<<<<<< + * + * # def fit_wrap_loop(size_t max_nodes): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_r_out); __pyx_r = __pyx_v_r_out; goto __pyx_L0; - /* "corels/_corels.pyx":344 - * return (run_corels_loop(max_num_nodes, pmap, tree, queue) != -1) + /* "corels/_corels.pyx":171 + * cdef set[string] run_verbosity * - * def fit_wrap_end(int early): # <<<<<<<<<<<<<< - * global rules - * global labels_vecs + * def fit_wrap_begin(np.ndarray[np.uint8_t, ndim=2] samples, # <<<<<<<<<<<<<< + * np.ndarray[np.uint8_t, ndim=2] labels, + * features, int max_card, double min_support, verbosity_str, int mine_verbose, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("corels._corels.fit_wrap_end", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_samples.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("corels._corels.fit_wrap_begin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; + goto __pyx_L2; __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_samples.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF(__pyx_v_nsamples); + __Pyx_XDECREF(__pyx_v_bytestr); + __Pyx_XDECREF(__pyx_v_verbosity_ascii); __Pyx_XDECREF(__pyx_v_r_out); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); @@ -8239,13 +7881,10 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_corels_pyx, __pyx_k_corels_pyx, sizeof(__pyx_k_corels_pyx), 0, 0, 1, 0}, {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1}, {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, - {&__pyx_n_s_early, __pyx_k_early, sizeof(__pyx_k_early), 0, 0, 1, 1}, {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, {&__pyx_n_s_features, __pyx_k_features, sizeof(__pyx_k_features), 0, 0, 1, 1}, {&__pyx_n_s_features_vec, __pyx_k_features_vec, sizeof(__pyx_k_features_vec), 0, 0, 1, 1}, {&__pyx_n_s_fit_wrap_begin, __pyx_k_fit_wrap_begin, sizeof(__pyx_k_fit_wrap_begin), 0, 0, 1, 1}, - {&__pyx_n_s_fit_wrap_end, __pyx_k_fit_wrap_end, sizeof(__pyx_k_fit_wrap_end), 0, 0, 1, 1}, - {&__pyx_n_s_fit_wrap_loop, __pyx_k_fit_wrap_loop, sizeof(__pyx_k_fit_wrap_loop), 0, 0, 1, 1}, {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, {&__pyx_n_s_idx, __pyx_k_idx, sizeof(__pyx_k_idx), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, @@ -8254,10 +7893,10 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_map_type, __pyx_k_map_type, sizeof(__pyx_k_map_type), 0, 0, 1, 1}, {&__pyx_n_s_max_card, __pyx_k_max_card, sizeof(__pyx_k_max_card), 0, 0, 1, 1}, - {&__pyx_n_s_max_nodes, __pyx_k_max_nodes, sizeof(__pyx_k_max_nodes), 0, 0, 1, 1}, {&__pyx_n_s_max_num_nodes, __pyx_k_max_num_nodes, sizeof(__pyx_k_max_num_nodes), 0, 0, 1, 1}, {&__pyx_n_s_min_support, __pyx_k_min_support, sizeof(__pyx_k_min_support), 0, 0, 1, 1}, {&__pyx_n_s_mine_verbose, __pyx_k_mine_verbose, sizeof(__pyx_k_mine_verbose), 0, 0, 1, 1}, + {&__pyx_n_s_minor_count, __pyx_k_minor_count, sizeof(__pyx_k_minor_count), 0, 0, 1, 1}, {&__pyx_n_s_minor_verbose, __pyx_k_minor_verbose, sizeof(__pyx_k_minor_verbose), 0, 0, 1, 1}, {&__pyx_n_s_mr, __pyx_k_mr, sizeof(__pyx_k_mr), 0, 0, 1, 1}, {&__pyx_n_s_n_rules, __pyx_k_n_rules, sizeof(__pyx_k_n_rules), 0, 0, 1, 1}, @@ -8270,6 +7909,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, {&__pyx_n_s_nsamples, __pyx_k_nsamples, sizeof(__pyx_k_nsamples), 0, 0, 1, 1}, {&__pyx_n_s_nsamples_chk, __pyx_k_nsamples_chk, sizeof(__pyx_k_nsamples_chk), 0, 0, 1, 1}, + {&__pyx_n_s_num_threads, __pyx_k_num_threads, sizeof(__pyx_k_num_threads), 0, 0, 1, 1}, {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, {&__pyx_kp_u_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 1, 0, 0}, {&__pyx_kp_u_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 1, 0, 0}, @@ -8279,7 +7919,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_predict_wrap, __pyx_k_predict_wrap, sizeof(__pyx_k_predict_wrap), 0, 0, 1, 1}, {&__pyx_n_u_prediction, __pyx_k_prediction, sizeof(__pyx_k_prediction), 0, 1, 0, 1}, {&__pyx_n_s_predictions, __pyx_k_predictions, sizeof(__pyx_k_predictions), 0, 0, 1, 1}, - {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1}, {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1}, {&__pyx_n_s_r_out, __pyx_k_r_out, sizeof(__pyx_k_r_out), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, @@ -8299,10 +7938,9 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, 0, 0, 0, 0, 0, 0} }; static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 81, __pyx_L1_error) - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 125, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 144, __pyx_L1_error) - __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_n_s_print); if (!__pyx_builtin_print) __PYX_ERR(0, 356, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 76, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 120, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 139, __pyx_L1_error) __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 855, __pyx_L1_error) __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 1037, __pyx_L1_error) return 0; @@ -8314,14 +7952,14 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "corels/_corels.pyx":144 + /* "corels/_corels.pyx":139 * * free(vectors) * raise ValueError("Could not load samples") # <<<<<<<<<<<<<< * * ncount_out[0] = ncount */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_Could_not_load_samples); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_Could_not_load_samples); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); @@ -8402,53 +8040,29 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); - /* "corels/_corels.pyx":65 + /* "corels/_corels.pyx":60 * @cython.boundscheck(False) * @cython.wraparound(False) * def predict_wrap(np.ndarray[np.uint8_t, ndim=2] X, rules): # <<<<<<<<<<<<<< * cdef int nsamples = X.shape[0] * cdef int nfeatures = X.shape[1] */ - __pyx_tuple__11 = PyTuple_Pack(17, __pyx_n_s_X, __pyx_n_s_rules, __pyx_n_s_nsamples, __pyx_n_s_nfeatures, __pyx_n_s_out, __pyx_n_s_n_rules, __pyx_n_s_s, __pyx_n_s_r, __pyx_n_s_next_rule, __pyx_n_s_nidx, __pyx_n_s_a, __pyx_n_s_idx, __pyx_n_s_c, __pyx_n_s_default, __pyx_n_s_antecedent_lengths, __pyx_n_s_predictions, __pyx_n_s_antecedents); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 65, __pyx_L1_error) + __pyx_tuple__11 = PyTuple_Pack(17, __pyx_n_s_X, __pyx_n_s_rules, __pyx_n_s_nsamples, __pyx_n_s_nfeatures, __pyx_n_s_out, __pyx_n_s_n_rules, __pyx_n_s_s, __pyx_n_s_r, __pyx_n_s_next_rule, __pyx_n_s_nidx, __pyx_n_s_a, __pyx_n_s_idx, __pyx_n_s_c, __pyx_n_s_default, __pyx_n_s_antecedent_lengths, __pyx_n_s_predictions, __pyx_n_s_antecedents); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); - __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 17, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_corels_pyx, __pyx_n_s_predict_wrap, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 65, __pyx_L1_error) + __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 17, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_corels_pyx, __pyx_n_s_predict_wrap, 60, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 60, __pyx_L1_error) - /* "corels/_corels.pyx":179 + /* "corels/_corels.pyx":171 * cdef set[string] run_verbosity * * def fit_wrap_begin(np.ndarray[np.uint8_t, ndim=2] samples, # <<<<<<<<<<<<<< * np.ndarray[np.uint8_t, ndim=2] labels, * features, int max_card, double min_support, verbosity_str, int mine_verbose, */ - __pyx_tuple__13 = PyTuple_Pack(27, __pyx_n_s_samples, __pyx_n_s_labels, __pyx_n_s_features, __pyx_n_s_max_card, __pyx_n_s_min_support, __pyx_n_s_verbosity_str, __pyx_n_s_mine_verbose, __pyx_n_s_minor_verbose, __pyx_n_s_c, __pyx_n_s_policy, __pyx_n_s_map_type, __pyx_n_s_ablation, __pyx_n_s_calculate_size, __pyx_n_s_pre_mine, __pyx_n_s_nfeatures, __pyx_n_s_samples_vecs, __pyx_n_s_nsamples, __pyx_n_s_features_vec, __pyx_n_s_i, __pyx_n_s_bytestr, __pyx_n_s_j, __pyx_n_s_r, __pyx_n_s_verbosity_ascii, __pyx_n_s_verbosity, __pyx_n_s_nsamples_chk, __pyx_n_s_mr, __pyx_n_s_rb); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 179, __pyx_L1_error) + __pyx_tuple__13 = PyTuple_Pack(33, __pyx_n_s_samples, __pyx_n_s_labels, __pyx_n_s_features, __pyx_n_s_max_card, __pyx_n_s_min_support, __pyx_n_s_verbosity_str, __pyx_n_s_mine_verbose, __pyx_n_s_minor_verbose, __pyx_n_s_c, __pyx_n_s_policy, __pyx_n_s_map_type, __pyx_n_s_ablation, __pyx_n_s_calculate_size, __pyx_n_s_pre_mine, __pyx_n_s_num_threads, __pyx_n_s_max_num_nodes, __pyx_n_s_nfeatures, __pyx_n_s_samples_vecs, __pyx_n_s_nsamples, __pyx_n_s_features_vec, __pyx_n_s_i, __pyx_n_s_bytestr, __pyx_n_s_j, __pyx_n_s_r, __pyx_n_s_verbosity_ascii, __pyx_n_s_verbosity, __pyx_n_s_nsamples_chk, __pyx_n_s_minor_count, __pyx_n_s_mr, __pyx_n_s_rulelist, __pyx_n_s_classes, __pyx_n_s_rb, __pyx_n_s_r_out); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); - __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(14, 0, 27, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_corels_pyx, __pyx_n_s_fit_wrap_begin, 179, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 179, __pyx_L1_error) - - /* "corels/_corels.pyx":339 - * return True - * - * def fit_wrap_loop(size_t max_nodes): # <<<<<<<<<<<<<< - * cdef size_t max_num_nodes = max_nodes - * # This is where the magic happens - */ - __pyx_tuple__15 = PyTuple_Pack(3, __pyx_n_s_max_nodes, __pyx_n_s_max_nodes, __pyx_n_s_max_num_nodes); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 339, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__15); - __Pyx_GIVEREF(__pyx_tuple__15); - __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_corels_pyx, __pyx_n_s_fit_wrap_loop, 339, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 339, __pyx_L1_error) - - /* "corels/_corels.pyx":344 - * return (run_corels_loop(max_num_nodes, pmap, tree, queue) != -1) - * - * def fit_wrap_end(int early): # <<<<<<<<<<<<<< - * global rules - * global labels_vecs - */ - __pyx_tuple__17 = PyTuple_Pack(7, __pyx_n_s_early, __pyx_n_s_early, __pyx_n_s_rulelist, __pyx_n_s_classes, __pyx_n_s_r_out, __pyx_n_s_i, __pyx_n_s_j); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 344, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__17); - __Pyx_GIVEREF(__pyx_tuple__17); - __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_corels_pyx, __pyx_n_s_fit_wrap_end, 344, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 344, __pyx_L1_error) + __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(16, 0, 33, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_corels_pyx, __pyx_n_s_fit_wrap_begin, 171, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -8774,19 +8388,19 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "corels/_corels.pyx":65 + /* "corels/_corels.pyx":60 * @cython.boundscheck(False) * @cython.wraparound(False) * def predict_wrap(np.ndarray[np.uint8_t, ndim=2] X, rules): # <<<<<<<<<<<<<< * cdef int nsamples = X.shape[0] * cdef int nfeatures = X.shape[1] */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6corels_7_corels_1predict_wrap, NULL, __pyx_n_s_corels__corels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6corels_7_corels_1predict_wrap, NULL, __pyx_n_s_corels__corels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_predict_wrap, __pyx_t_1) < 0) __PYX_ERR(0, 65, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_predict_wrap, __pyx_t_1) < 0) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "corels/_corels.pyx":169 + /* "corels/_corels.pyx":161 * free(vs) * * cdef rule_t* rules = NULL # <<<<<<<<<<<<<< @@ -8795,7 +8409,7 @@ if (!__Pyx_RefNanny) { */ __pyx_v_6corels_7_corels_rules = NULL; - /* "corels/_corels.pyx":170 + /* "corels/_corels.pyx":162 * * cdef rule_t* rules = NULL * cdef rule_t* labels_vecs = NULL # <<<<<<<<<<<<<< @@ -8804,7 +8418,7 @@ if (!__Pyx_RefNanny) { */ __pyx_v_6corels_7_corels_labels_vecs = NULL; - /* "corels/_corels.pyx":171 + /* "corels/_corels.pyx":163 * cdef rule_t* rules = NULL * cdef rule_t* labels_vecs = NULL * cdef rule_t* minor = NULL # <<<<<<<<<<<<<< @@ -8813,7 +8427,7 @@ if (!__Pyx_RefNanny) { */ __pyx_v_6corels_7_corels_minor = NULL; - /* "corels/_corels.pyx":172 + /* "corels/_corels.pyx":164 * cdef rule_t* labels_vecs = NULL * cdef rule_t* minor = NULL * cdef int n_rules = 0 # <<<<<<<<<<<<<< @@ -8822,7 +8436,7 @@ if (!__Pyx_RefNanny) { */ __pyx_v_6corels_7_corels_n_rules = 0; - /* "corels/_corels.pyx":173 + /* "corels/_corels.pyx":165 * cdef rule_t* minor = NULL * cdef int n_rules = 0 * cdef PermutationMap* pmap = NULL # <<<<<<<<<<<<<< @@ -8831,7 +8445,7 @@ if (!__Pyx_RefNanny) { */ __pyx_v_6corels_7_corels_pmap = NULL; - /* "corels/_corels.pyx":174 + /* "corels/_corels.pyx":166 * cdef int n_rules = 0 * cdef PermutationMap* pmap = NULL * cdef CacheTree* tree = NULL # <<<<<<<<<<<<<< @@ -8840,7 +8454,7 @@ if (!__Pyx_RefNanny) { */ __pyx_v_6corels_7_corels_tree = NULL; - /* "corels/_corels.pyx":175 + /* "corels/_corels.pyx":167 * cdef PermutationMap* pmap = NULL * cdef CacheTree* tree = NULL * cdef Queue* queue = NULL # <<<<<<<<<<<<<< @@ -8849,7 +8463,7 @@ if (!__Pyx_RefNanny) { */ __pyx_v_6corels_7_corels_queue = NULL; - /* "corels/_corels.pyx":176 + /* "corels/_corels.pyx":168 * cdef CacheTree* tree = NULL * cdef Queue* queue = NULL * cdef double init = 0.0 # <<<<<<<<<<<<<< @@ -8858,40 +8472,16 @@ if (!__Pyx_RefNanny) { */ __pyx_v_6corels_7_corels_init = 0.0; - /* "corels/_corels.pyx":179 + /* "corels/_corels.pyx":171 * cdef set[string] run_verbosity * * def fit_wrap_begin(np.ndarray[np.uint8_t, ndim=2] samples, # <<<<<<<<<<<<<< * np.ndarray[np.uint8_t, ndim=2] labels, * features, int max_card, double min_support, verbosity_str, int mine_verbose, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6corels_7_corels_3fit_wrap_begin, NULL, __pyx_n_s_corels__corels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_fit_wrap_begin, __pyx_t_1) < 0) __PYX_ERR(0, 179, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "corels/_corels.pyx":339 - * return True - * - * def fit_wrap_loop(size_t max_nodes): # <<<<<<<<<<<<<< - * cdef size_t max_num_nodes = max_nodes - * # This is where the magic happens - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6corels_7_corels_5fit_wrap_loop, NULL, __pyx_n_s_corels__corels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_fit_wrap_loop, __pyx_t_1) < 0) __PYX_ERR(0, 339, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "corels/_corels.pyx":344 - * return (run_corels_loop(max_num_nodes, pmap, tree, queue) != -1) - * - * def fit_wrap_end(int early): # <<<<<<<<<<<<<< - * global rules - * global labels_vecs - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6corels_7_corels_7fit_wrap_end, NULL, __pyx_n_s_corels__corels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6corels_7_corels_3fit_wrap_begin, NULL, __pyx_n_s_corels__corels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_fit_wrap_end, __pyx_t_1) < 0) __PYX_ERR(0, 344, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_fit_wrap_begin, __pyx_t_1) < 0) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "corels/_corels.pyx":1 diff --git a/corels/_corels.pyx b/corels/_corels.pyx index bbdcc50..47cc09a 100644 --- a/corels/_corels.pyx +++ b/corels/_corels.pyx @@ -10,14 +10,14 @@ import numpy as np cimport numpy as np cimport cython -cdef extern from "src/corels/src/rule.hh": +cdef extern from "src/corels/src/rule.h": ctypedef unsigned long* VECTOR cdef struct rule: - VECTOR truthtable char* features - int cardinality - int* ids int support + int cardinality + int *ids + VECTOR truthtable ctypedef rule rule_t @@ -30,23 +30,18 @@ cdef extern from "src/corels/src/rule.hh": int count_ones_vector(VECTOR, int) cdef extern from "src/corels/src/run.hh": - int run_corels_begin(double c, char* vstring, int curiosity_policy, - int map_type, int ablation, int calculate_size, int nrules, int nlabels, - int nsamples, rule_t* rules, rule_t* labels, rule_t* meta, int freq, char* log_fname, - PermutationMap*& pmap, CacheTree*& tree, Queue*& queue, double& init, - set[string]& verbosity) - - int run_corels_loop(size_t max_num_nodes, PermutationMap* pmap, CacheTree* tree, Queue* queue) - - double run_corels_end(vector[int]* rulelist, vector[int]* classes, int early, int latex_out, rule_t* rules, - rule_t* labels, char* opt_fname, PermutationMap*& pmap, CacheTree*& tree, Queue*& queue, - double init, set[string]& verbosity) + double run_corels(double c, char* vstring, int curiosity_policy, + int map_type, int ablation, int calculate_size, int nrules, int nlabels, + int nsamples, rule_t* rules, rule_t* labels, rule_t* meta, int freq, char* log_fname, + PermutationMap*& pmap, CacheTree*& tree, Queue*& queue, double& init, + int verbosity, int num_threads, int max_num_nodes, int nmeta, int random_seed, + vector[int]* rulelist, vector[int]* classes) cdef extern from "src/utils.hh": int mine_rules(char **features, rule_t *samples, int nfeatures, int nsamples, int max_card, double min_support, rule_t **rules_out, int verbose, int pre_mine) - int minority(rule_t* rules, int nrules, rule_t* labels, int nsamples, rule_t* minority_out, int verbose) + int minority(rule_t* rules, int nrules, rule_t* labels, int nsamples, rule_t* minority_out, int verbose, int* minor_count) cdef extern from "src/corels/src/pmap.hh": cdef cppclass PermutationMap: @@ -145,7 +140,6 @@ cdef rule_t* _to_vector(np.ndarray[np.uint8_t, ndim=2] X, int* ncount_out): ncount_out[0] = ncount - vectors[i].ids = NULL vectors[i].features = NULL vectors[i].cardinality = 1 vectors[i].support = nones @@ -158,8 +152,6 @@ cdef _free_vector(rule_t* vs, int count): for i in range(count): rule_vfree(&vs[i].truthtable) - if vs[i].ids: - free(vs[i].ids) if vs[i].features: free(vs[i].features) @@ -180,7 +172,7 @@ def fit_wrap_begin(np.ndarray[np.uint8_t, ndim=2] samples, np.ndarray[np.uint8_t, ndim=2] labels, features, int max_card, double min_support, verbosity_str, int mine_verbose, int minor_verbose, double c, int policy, int map_type, int ablation, - int calculate_size, int pre_mine): + int calculate_size, int pre_mine, int num_threads, int max_num_nodes): global rules global labels_vecs global minor @@ -299,7 +291,8 @@ def fit_wrap_begin(np.ndarray[np.uint8_t, ndim=2] samples, n_rules = 0 raise MemoryError(); - cdef int mr = minority(rules, n_rules, labels_vecs, nsamples, minor, minor_verbose) + cdef int minor_count = 0; + cdef int mr = minority(rules, n_rules, labels_vecs, nsamples, minor, minor_verbose, &minor_count) if mr != 0: if labels_vecs != NULL: _free_vector(labels_vecs, 2) @@ -315,45 +308,15 @@ def fit_wrap_begin(np.ndarray[np.uint8_t, ndim=2] samples, _free_vector(minor, 1) minor = NULL """ - - cdef int rb = run_corels_begin(c, verbosity, policy, map_type, ablation, calculate_size, - n_rules, 2, nsamples, rules, labels_vecs, minor, 0, NULL, pmap, tree, - queue, init, run_verbosity) - - if rb == -1: - if labels_vecs != NULL: - _free_vector(labels_vecs, 2) - labels_vecs = NULL - if minor != NULL: - _free_vector(minor, 1) - minor = NULL - if rules != NULL: - _free_vector(rules, n_rules) - rules = NULL - n_rules = 0 - - return False - - return True - -def fit_wrap_loop(size_t max_nodes): - cdef size_t max_num_nodes = max_nodes - # This is where the magic happens - return (run_corels_loop(max_num_nodes, pmap, tree, queue) != -1) - -def fit_wrap_end(int early): - global rules - global labels_vecs - global minor - global n_rules - cdef vector[int] rulelist cdef vector[int] classes - run_corels_end(&rulelist, &classes, early, 0, NULL, NULL, NULL, pmap, tree, - queue, init, run_verbosity) + + cdef double rb = run_corels(c, verbosity, policy, map_type, ablation, calculate_size, + n_rules, 2, nsamples, rules, labels_vecs, minor, 1000, NULL, pmap, tree, + queue, init, 10, num_threads, max_num_nodes, minor_count, 262, + &rulelist, &classes) r_out = [] - print(rulelist.size()) for i in range(rulelist.size()): if rulelist[i] < n_rules: r_out.append({}) @@ -365,18 +328,63 @@ def fit_wrap_end(int early): r_out.append({ "antecedents": [0], "prediction": bool(classes[rulelist.size()]) }) - # Exiting early skips cleanup - if early == 0: - if labels_vecs != NULL: + if rb == -1: + if labels_vecs != NULL: _free_vector(labels_vecs, 2) - if minor != NULL: + labels_vecs = NULL + if minor != NULL: _free_vector(minor, 1) - if rules != NULL: + minor = NULL + if rules != NULL: _free_vector(rules, n_rules) - - minor = NULL - rules = NULL - labels_vecs = NULL - n_rules = 0 + rules = NULL + n_rules = 0 + + return Exception return r_out + +# def fit_wrap_loop(size_t max_nodes): +# cdef size_t max_num_nodes = max_nodes +# # This is where the magic happens +# return (run_corels_loop(max_num_nodes, pmap, tree, queue) != -1) +# +# def fit_wrap_end(int early): +# global rules +# global labels_vecs +# global minor +# global n_rules +# +# cdef vector[int] rulelist +# cdef vector[int] classes +# run_corels_end(&rulelist, &classes, early, 0, NULL, NULL, NULL, pmap, tree, +# queue, init, run_verbosity) +# +# r_out = [] +# print(rulelist.size()) +# for i in range(rulelist.size()): +# if rulelist[i] < n_rules: +# r_out.append({}) +# r_out[i]["antecedents"] = [] +# for j in range(rules[rulelist[i]].cardinality): +# r_out[i]["antecedents"].append(rules[rulelist[i]].ids[j]) +# +# r_out[i]["prediction"] = bool(classes[i]) +# +# r_out.append({ "antecedents": [0], "prediction": bool(classes[rulelist.size()]) }) +# +# # Exiting early skips cleanup +# if early == 0: +# if labels_vecs != NULL: +# _free_vector(labels_vecs, 2) +# if minor != NULL: +# _free_vector(minor, 1) +# if rules != NULL: +# _free_vector(rules, n_rules) +# +# minor = NULL +# rules = NULL +# labels_vecs = NULL +# n_rules = 0 +# +# return r_out diff --git a/corels/corels.py b/corels/corels.py index eb1dc14..bc7e99f 100644 --- a/corels/corels.py +++ b/corels/corels.py @@ -1,5 +1,5 @@ from __future__ import print_function, division, with_statement -from ._corels import fit_wrap_begin, fit_wrap_end, fit_wrap_loop, predict_wrap +from ._corels import fit_wrap_begin, predict_wrap from .utils import check_consistent_length, check_array, check_is_fitted, get_feature, check_in, check_features, check_rulelist, RuleList import numpy as np import pickle @@ -92,7 +92,7 @@ class CorelsClassifier: _estimator_type = "classifier" def __init__(self, c=0.01, n_iter=10000, map_type="prefix", policy="lower_bound", - verbosity=["rulelist"], ablation=0, max_card=2, min_support=0.01, pre_mine=1): + verbosity=["rulelist"], ablation=0, max_card=2, min_support=0.01, pre_mine=1, random_seed=262): self.c = c self.n_iter = n_iter self.map_type = map_type @@ -102,6 +102,7 @@ def __init__(self, c=0.01, n_iter=10000, map_type="prefix", policy="lower_bound" self.max_card = max_card self.min_support = min_support self.pre_mine = pre_mine + self.random_seed = random_seed def fit(self, X, y, features=[], prediction_name="prediction"): """ @@ -158,6 +159,8 @@ def fit(self, X, y, features=[], prediction_name="prediction"): raise TypeError("Prediction name must be a string, got: " + str(type(prediction_name))) if not isinstance(self.pre_mine, int): raise TypeError("Pre_mine must be an int, got: " + str(type(self.pre_mine))) + if not isinstance(self.random_seed, int): + raise TypeError("Pre_mine must be an int, got: " + str(type(self.random_seed))) label = check_array(y, ndim=1) labels = np.stack([ np.invert(label), label ]) @@ -233,33 +236,15 @@ def fit(self, X, y, features=[], prediction_name="prediction"): map_id = map_types.index(self.map_type) policy_id = policies.index(self.policy) - fr = fit_wrap_begin(samples.astype(np.uint8, copy=False), + rl.rules = fit_wrap_begin(samples.astype(np.uint8, copy=False), labels.astype(np.uint8, copy=False), rl.features, self.max_card, self.min_support, verbose, mine_verbose, minor_verbose, - self.c, policy_id, map_id, self.ablation, False, self.pre_mine) - - if fr: - early = False - try: - while fit_wrap_loop(self.n_iter): - pass - except: - print("\nExiting early") - rl.rules = fit_wrap_end(True) - - self.rl_ = rl - - if "rulelist" in self.verbosity: - print(self.rl_) - - raise - - rl.rules = fit_wrap_end(False) + self.c, policy_id, map_id, self.ablation, False, self.pre_mine, 1, self.n_iter) - self.rl_ = rl + self.rl_ = rl - if "rulelist" in self.verbosity: - print(self.rl_) + if "rulelist" in self.verbosity: + print(self.rl_) else: print("Error running model! Exiting") diff --git a/corels/src/corels b/corels/src/corels index e09f71f..b5498c9 160000 --- a/corels/src/corels +++ b/corels/src/corels @@ -1 +1 @@ -Subproject commit e09f71fd524042f84623614908694aadf0965474 +Subproject commit b5498c919e1afb849207ffcaf57584223f9de312 diff --git a/corels/src/utils.cpp b/corels/src/utils.cpp index f938cbd..8bc95bd 100755 --- a/corels/src/utils.cpp +++ b/corels/src/utils.cpp @@ -12,7 +12,7 @@ int sample_comp(const void *a, const void *b) { samples_nrules, samples_nrules); } -int minority(rule_t* rules, int nrules, rule_t* labels, int nsamples, rule_t* minority_out, int verbose) +int minority(rule_t* rules, int nrules, rule_t* labels, int nsamples, rule_t* minority_out, int verbose, int* minority_count) { if(!rules || !labels || !minority_out) { return -1; @@ -103,8 +103,10 @@ int minority(rule_t* rules, int nrules, rule_t* labels, int nsamples, rule_t* mi strcpy(minority_out->features, "minority"); minority_out->ids = NULL; - if(verbose) - printf("Generated minority bound with support %f\n", (double)minority_out->support / (double)nsamples); + if(verbose) { + printf("Generated minority bound with support %f\n", (double)minority_out->support / (double)nsamples); + (*minority_count)++; + } end: if(line_clean) diff --git a/corels/src/utils.hh b/corels/src/utils.hh index 5cb60f9..59ed9d9 100644 --- a/corels/src/utils.hh +++ b/corels/src/utils.hh @@ -1,11 +1,11 @@ #ifndef UTILS_H #define UTILS_H -#include "rule.hh" +#include "rule.h" int mine_rules(char** features, rule_t *samples, int nfeatures, int nsamples, int max_card, double min_support, rule_t **rules_out, int verbose, int pre_mine); -int minority(rule_t* rules, int nrules, rule_t* labels, int nsamples, rule_t* minority_out, int verbose); +int minority(rule_t* rules, int nrules, rule_t* labels, int nsamples, rule_t* minority_out, int verbose, int* minority_count); #endif diff --git a/setup.py b/setup.py index 87e13cd..c20ecef 100644 --- a/setup.py +++ b/setup.py @@ -20,8 +20,8 @@ def install(gmp): version = f.read().strip() source_dir = 'corels/src/corels/src/' - sources = ['utils.cpp', 'rulelib.cpp', 'run.cpp', 'pmap.cpp', - 'corels.cpp', 'cache.cpp'] + sources = ['utils.cc', 'rulelib.c', 'run.cc', 'pmap.cc', + 'corels.cc', 'cache.cc'] for i in range(len(sources)): sources[i] = source_dir + sources[i] @@ -29,7 +29,7 @@ def install(gmp): sources.append('corels/_corels.cpp') sources.append('corels/src/utils.cpp') - cpp_args = ['-Wall', '-O3', '-std=c++11'] + cpp_args = ['-g', '-Wall', '-O0', '-std=c++11'] libraries = [] if os.name == 'posix': From 310e5c49827152b46a497ac00fa6f9642584a95e Mon Sep 17 00:00:00 2001 From: alexander Date: Mon, 22 Jun 2020 11:09:29 -0700 Subject: [PATCH 3/5] added correct corels submodule and update .gitmodules to point at the correct repo --- .gitmodules | 2 +- corels/.gitignore | 3 ++- corels/src/corels | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index d74cfdd..c8cb450 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "corels/src/corels"] path = corels/src/corels - url = https://github.com/fingoldin/corels.git + url = https://github.com/alexzheng587/corels.git diff --git a/corels/.gitignore b/corels/.gitignore index 723ef36..54d749a 100644 --- a/corels/.gitignore +++ b/corels/.gitignore @@ -1 +1,2 @@ -.idea \ No newline at end of file +.idea +../cython_debug/ \ No newline at end of file diff --git a/corels/src/corels b/corels/src/corels index b5498c9..a19504c 160000 --- a/corels/src/corels +++ b/corels/src/corels @@ -1 +1 @@ -Subproject commit b5498c919e1afb849207ffcaf57584223f9de312 +Subproject commit a19504c9e68b217307d252ffc0cc4c378b593b2e From 480e39a52a50d8692a38b58f79916b602faf48c8 Mon Sep 17 00:00:00 2001 From: Wesley Date: Mon, 22 Jun 2020 12:02:41 -0700 Subject: [PATCH 4/5] make num_threads a parameter --- corels/corels.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/corels/corels.py b/corels/corels.py index bc7e99f..e5ba027 100644 --- a/corels/corels.py +++ b/corels/corels.py @@ -92,7 +92,7 @@ class CorelsClassifier: _estimator_type = "classifier" def __init__(self, c=0.01, n_iter=10000, map_type="prefix", policy="lower_bound", - verbosity=["rulelist"], ablation=0, max_card=2, min_support=0.01, pre_mine=1, random_seed=262): + verbosity=["rulelist"], ablation=0, max_card=2, min_support=0.01, pre_mine=1, random_seed=262, num_threads=1): self.c = c self.n_iter = n_iter self.map_type = map_type @@ -103,6 +103,7 @@ def __init__(self, c=0.01, n_iter=10000, map_type="prefix", policy="lower_bound" self.min_support = min_support self.pre_mine = pre_mine self.random_seed = random_seed + self.num_threads = num_threads def fit(self, X, y, features=[], prediction_name="prediction"): """ @@ -239,7 +240,7 @@ def fit(self, X, y, features=[], prediction_name="prediction"): rl.rules = fit_wrap_begin(samples.astype(np.uint8, copy=False), labels.astype(np.uint8, copy=False), rl.features, self.max_card, self.min_support, verbose, mine_verbose, minor_verbose, - self.c, policy_id, map_id, self.ablation, False, self.pre_mine, 1, self.n_iter) + self.c, policy_id, map_id, self.ablation, False, self.pre_mine, self.num_threads, self.n_iter) self.rl_ = rl From 35692d6604d48ba22f67b743f5a69902533d4427 Mon Sep 17 00:00:00 2001 From: alexander Date: Wed, 24 Jun 2020 17:49:36 -0700 Subject: [PATCH 5/5] added option to include .minor file --- corels/_corels.cpp | 1583 +++++++++++++++++++++++++------------------- corels/_corels.pyx | 72 +- corels/corels.py | 19 +- corels/src/corels | 2 +- 4 files changed, 947 insertions(+), 729 deletions(-) diff --git a/corels/_corels.cpp b/corels/_corels.cpp index a172554..b75f8b8 100644 --- a/corels/_corels.cpp +++ b/corels/_corels.cpp @@ -1602,6 +1602,9 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value); +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + /* RealImag.proto */ #if CYTHON_CCOMPLEX #ifdef __cplusplus @@ -1709,9 +1712,6 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *); -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); - /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); @@ -1747,10 +1747,10 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'libcpp.string' */ -/* Module declarations from 'cpython.buffer' */ - /* Module declarations from 'libc.stdio' */ +/* Module declarations from 'cpython.buffer' */ + /* Module declarations from '__builtin__' */ /* Module declarations from 'cpython.type' */ @@ -1809,11 +1809,11 @@ static const char __pyx_k_j[] = "j"; static const char __pyx_k_r[] = "r"; static const char __pyx_k_s[] = "s"; static const char __pyx_k__3[] = ")"; -static const char __pyx_k_mr[] = "mr"; static const char __pyx_k_np[] = "np"; static const char __pyx_k_rb[] = "rb"; static const char __pyx_k_idx[] = "idx"; static const char __pyx_k_out[] = "out"; +static const char __pyx_k_freq[] = "freq"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_nidx[] = "nidx"; @@ -1856,6 +1856,7 @@ static const char __pyx_k_min_support[] = "min_support"; static const char __pyx_k_minor_count[] = "minor_count"; static const char __pyx_k_num_threads[] = "num_threads"; static const char __pyx_k_predictions[] = "predictions"; +static const char __pyx_k_random_seed[] = "random_seed"; static const char __pyx_k_RuntimeError[] = "RuntimeError"; static const char __pyx_k_features_vec[] = "features_vec"; static const char __pyx_k_mine_verbose[] = "mine_verbose"; @@ -1865,6 +1866,7 @@ static const char __pyx_k_samples_vecs[] = "samples_vecs"; static const char __pyx_k_and_rule_data[] = ") and rule data ("; static const char __pyx_k_max_num_nodes[] = "max_num_nodes"; static const char __pyx_k_minor_verbose[] = "minor_verbose"; +static const char __pyx_k_minority_list[] = "minority_list"; static const char __pyx_k_verbosity_str[] = "verbosity_str"; static const char __pyx_k_calculate_size[] = "calculate_size"; static const char __pyx_k_corels__corels[] = "corels._corels"; @@ -1921,6 +1923,7 @@ static PyObject *__pyx_n_s_encode; static PyObject *__pyx_n_s_features; static PyObject *__pyx_n_s_features_vec; static PyObject *__pyx_n_s_fit_wrap_begin; +static PyObject *__pyx_n_s_freq; static PyObject *__pyx_n_s_i; static PyObject *__pyx_n_s_idx; static PyObject *__pyx_n_s_import; @@ -1934,7 +1937,7 @@ static PyObject *__pyx_n_s_min_support; static PyObject *__pyx_n_s_mine_verbose; static PyObject *__pyx_n_s_minor_count; static PyObject *__pyx_n_s_minor_verbose; -static PyObject *__pyx_n_s_mr; +static PyObject *__pyx_n_s_minority_list; static PyObject *__pyx_n_s_n_rules; static PyObject *__pyx_n_s_name; static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; @@ -1957,6 +1960,7 @@ static PyObject *__pyx_n_u_prediction; static PyObject *__pyx_n_s_predictions; static PyObject *__pyx_n_s_r; static PyObject *__pyx_n_s_r_out; +static PyObject *__pyx_n_s_random_seed; static PyObject *__pyx_n_s_range; static PyObject *__pyx_n_s_rb; static PyObject *__pyx_n_s_rulelist; @@ -1972,7 +1976,7 @@ static PyObject *__pyx_n_s_verbosity_ascii; static PyObject *__pyx_n_s_verbosity_str; static PyObject *__pyx_n_s_zeros; static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_X, PyObject *__pyx_v_rules); /* proto */ -static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_samples, PyArrayObject *__pyx_v_labels, PyObject *__pyx_v_features, int __pyx_v_max_card, double __pyx_v_min_support, PyObject *__pyx_v_verbosity_str, int __pyx_v_mine_verbose, int __pyx_v_minor_verbose, double __pyx_v_c, int __pyx_v_policy, int __pyx_v_map_type, int __pyx_v_ablation, int __pyx_v_calculate_size, int __pyx_v_pre_mine, int __pyx_v_num_threads, int __pyx_v_max_num_nodes); /* proto */ +static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_samples, PyArrayObject *__pyx_v_labels, PyObject *__pyx_v_features, int __pyx_v_max_card, double __pyx_v_min_support, PyObject *__pyx_v_verbosity_str, int __pyx_v_mine_verbose, int __pyx_v_minor_verbose, double __pyx_v_c, int __pyx_v_policy, int __pyx_v_map_type, int __pyx_v_ablation, int __pyx_v_calculate_size, int __pyx_v_pre_mine, int __pyx_v_num_threads, int __pyx_v_max_num_nodes, PyArrayObject *__pyx_v_minority_list, int __pyx_v_random_seed, int __pyx_v_freq); /* proto */ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ static PyObject *__pyx_int_0; @@ -1990,7 +1994,7 @@ static PyObject *__pyx_codeobj__12; static PyObject *__pyx_codeobj__14; /* Late includes */ -/* "corels/_corels.pyx":60 +/* "corels/_corels.pyx":61 * @cython.boundscheck(False) * @cython.wraparound(False) * def predict_wrap(np.ndarray[np.uint8_t, ndim=2] X, rules): # <<<<<<<<<<<<<< @@ -2033,11 +2037,11 @@ static PyObject *__pyx_pw_6corels_7_corels_1predict_wrap(PyObject *__pyx_self, P case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rules)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("predict_wrap", 1, 2, 2, 1); __PYX_ERR(0, 60, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("predict_wrap", 1, 2, 2, 1); __PYX_ERR(0, 61, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "predict_wrap") < 0)) __PYX_ERR(0, 60, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "predict_wrap") < 0)) __PYX_ERR(0, 61, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -2050,13 +2054,13 @@ static PyObject *__pyx_pw_6corels_7_corels_1predict_wrap(PyObject *__pyx_self, P } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("predict_wrap", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 60, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("predict_wrap", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 61, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("corels._corels.predict_wrap", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_ptype_5numpy_ndarray, 1, "X", 0))) __PYX_ERR(0, 60, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_ptype_5numpy_ndarray, 1, "X", 0))) __PYX_ERR(0, 61, __pyx_L1_error) __pyx_r = __pyx_pf_6corels_7_corels_predict_wrap(__pyx_self, __pyx_v_X, __pyx_v_rules); /* function exit code */ @@ -2117,11 +2121,11 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * __pyx_pybuffernd_X.rcbuffer = &__pyx_pybuffer_X; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_X.rcbuffer->pybuffer, (PyObject*)__pyx_v_X, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 60, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_X.rcbuffer->pybuffer, (PyObject*)__pyx_v_X, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 61, __pyx_L1_error) } __pyx_pybuffernd_X.diminfo[0].strides = __pyx_pybuffernd_X.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_X.diminfo[0].shape = __pyx_pybuffernd_X.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_X.diminfo[1].strides = __pyx_pybuffernd_X.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_X.diminfo[1].shape = __pyx_pybuffernd_X.rcbuffer->pybuffer.shape[1]; - /* "corels/_corels.pyx":61 + /* "corels/_corels.pyx":62 * @cython.wraparound(False) * def predict_wrap(np.ndarray[np.uint8_t, ndim=2] X, rules): * cdef int nsamples = X.shape[0] # <<<<<<<<<<<<<< @@ -2130,7 +2134,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * */ __pyx_v_nsamples = (__pyx_v_X->dimensions[0]); - /* "corels/_corels.pyx":62 + /* "corels/_corels.pyx":63 * def predict_wrap(np.ndarray[np.uint8_t, ndim=2] X, rules): * cdef int nsamples = X.shape[0] * cdef int nfeatures = X.shape[1] # <<<<<<<<<<<<<< @@ -2139,54 +2143,54 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * */ __pyx_v_nfeatures = (__pyx_v_X->dimensions[1]); - /* "corels/_corels.pyx":64 + /* "corels/_corels.pyx":65 * cdef int nfeatures = X.shape[1] * * cdef np.ndarray out = np.zeros(nsamples, dtype=np.uint8) # <<<<<<<<<<<<<< * cdef int n_rules = len(rules) - 1 * if n_rules < 0: */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nsamples); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nsamples); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 64, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 64, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 65, __pyx_L1_error) __pyx_v_out = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "corels/_corels.pyx":65 + /* "corels/_corels.pyx":66 * * cdef np.ndarray out = np.zeros(nsamples, dtype=np.uint8) * cdef int n_rules = len(rules) - 1 # <<<<<<<<<<<<<< * if n_rules < 0: * return out */ - __pyx_t_6 = PyObject_Length(__pyx_v_rules); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 65, __pyx_L1_error) + __pyx_t_6 = PyObject_Length(__pyx_v_rules); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 66, __pyx_L1_error) __pyx_v_n_rules = (__pyx_t_6 - 1); - /* "corels/_corels.pyx":66 + /* "corels/_corels.pyx":67 * cdef np.ndarray out = np.zeros(nsamples, dtype=np.uint8) * cdef int n_rules = len(rules) - 1 * if n_rules < 0: # <<<<<<<<<<<<<< @@ -2196,7 +2200,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * __pyx_t_7 = ((__pyx_v_n_rules < 0) != 0); if (__pyx_t_7) { - /* "corels/_corels.pyx":67 + /* "corels/_corels.pyx":68 * cdef int n_rules = len(rules) - 1 * if n_rules < 0: * return out # <<<<<<<<<<<<<< @@ -2208,7 +2212,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * __pyx_r = ((PyObject *)__pyx_v_out); goto __pyx_L0; - /* "corels/_corels.pyx":66 + /* "corels/_corels.pyx":67 * cdef np.ndarray out = np.zeros(nsamples, dtype=np.uint8) * cdef int n_rules = len(rules) - 1 * if n_rules < 0: # <<<<<<<<<<<<<< @@ -2217,23 +2221,23 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * */ } - /* "corels/_corels.pyx":70 + /* "corels/_corels.pyx":71 * * cdef int s, r, next_rule, nidx, a, idx, c * cdef int default = bool(rules[n_rules]["prediction"]) # <<<<<<<<<<<<<< * * cdef int* antecedent_lengths = malloc(sizeof(int) * n_rules) */ - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_rules, __pyx_v_n_rules, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 70, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_rules, __pyx_v_n_rules, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_u_prediction); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_u_prediction); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 70, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_default = (!(!__pyx_t_7)); - /* "corels/_corels.pyx":72 + /* "corels/_corels.pyx":73 * cdef int default = bool(rules[n_rules]["prediction"]) * * cdef int* antecedent_lengths = malloc(sizeof(int) * n_rules) # <<<<<<<<<<<<<< @@ -2242,7 +2246,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * */ __pyx_v_antecedent_lengths = ((int *)malloc(((sizeof(int)) * __pyx_v_n_rules))); - /* "corels/_corels.pyx":73 + /* "corels/_corels.pyx":74 * * cdef int* antecedent_lengths = malloc(sizeof(int) * n_rules) * cdef int* predictions = malloc(sizeof(int) * n_rules) # <<<<<<<<<<<<<< @@ -2251,7 +2255,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * */ __pyx_v_predictions = ((int *)malloc(((sizeof(int)) * __pyx_v_n_rules))); - /* "corels/_corels.pyx":74 + /* "corels/_corels.pyx":75 * cdef int* antecedent_lengths = malloc(sizeof(int) * n_rules) * cdef int* predictions = malloc(sizeof(int) * n_rules) * cdef int** antecedents = malloc(sizeof(int*) * n_rules) # <<<<<<<<<<<<<< @@ -2260,7 +2264,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * */ __pyx_v_antecedents = ((int **)malloc(((sizeof(int *)) * __pyx_v_n_rules))); - /* "corels/_corels.pyx":76 + /* "corels/_corels.pyx":77 * cdef int** antecedents = malloc(sizeof(int*) * n_rules) * * for r in range(n_rules): # <<<<<<<<<<<<<< @@ -2272,42 +2276,42 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_r = __pyx_t_10; - /* "corels/_corels.pyx":77 + /* "corels/_corels.pyx":78 * * for r in range(n_rules): * antecedent_lengths[r] = len(rules[r]["antecedents"]) # <<<<<<<<<<<<<< * predictions[r] = int(rules[r]["prediction"]) * antecedents[r] = malloc(sizeof(int) * antecedent_lengths[r]) */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_rules, __pyx_v_r, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_rules, __pyx_v_r, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_antecedents); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 77, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_antecedents); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 77, __pyx_L1_error) + __pyx_t_6 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; (__pyx_v_antecedent_lengths[__pyx_v_r]) = __pyx_t_6; - /* "corels/_corels.pyx":78 + /* "corels/_corels.pyx":79 * for r in range(n_rules): * antecedent_lengths[r] = len(rules[r]["antecedents"]) * predictions[r] = int(rules[r]["prediction"]) # <<<<<<<<<<<<<< * antecedents[r] = malloc(sizeof(int) * antecedent_lengths[r]) * for a in range(antecedent_lengths[r]): */ - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_rules, __pyx_v_r, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_rules, __pyx_v_r, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_u_prediction); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_u_prediction); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; (__pyx_v_predictions[__pyx_v_r]) = __pyx_t_11; - /* "corels/_corels.pyx":79 + /* "corels/_corels.pyx":80 * antecedent_lengths[r] = len(rules[r]["antecedents"]) * predictions[r] = int(rules[r]["prediction"]) * antecedents[r] = malloc(sizeof(int) * antecedent_lengths[r]) # <<<<<<<<<<<<<< @@ -2316,7 +2320,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * */ (__pyx_v_antecedents[__pyx_v_r]) = ((int *)malloc(((sizeof(int)) * (__pyx_v_antecedent_lengths[__pyx_v_r])))); - /* "corels/_corels.pyx":80 + /* "corels/_corels.pyx":81 * predictions[r] = int(rules[r]["prediction"]) * antecedents[r] = malloc(sizeof(int) * antecedent_lengths[r]) * for a in range(antecedent_lengths[r]): # <<<<<<<<<<<<<< @@ -2328,28 +2332,28 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { __pyx_v_a = __pyx_t_13; - /* "corels/_corels.pyx":81 + /* "corels/_corels.pyx":82 * antecedents[r] = malloc(sizeof(int) * antecedent_lengths[r]) * for a in range(antecedent_lengths[r]): * antecedents[r][a] = rules[r]["antecedents"][a] # <<<<<<<<<<<<<< * * # This compiles to C, so it's pretty fast! */ - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_rules, __pyx_v_r, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 81, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_rules, __pyx_v_r, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_u_antecedents); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_u_antecedents); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_a, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 81, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_a, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 81, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; ((__pyx_v_antecedents[__pyx_v_r])[__pyx_v_a]) = __pyx_t_14; } } - /* "corels/_corels.pyx":84 + /* "corels/_corels.pyx":85 * * # This compiles to C, so it's pretty fast! * for s in range(nsamples): # <<<<<<<<<<<<<< @@ -2361,7 +2365,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_s = __pyx_t_10; - /* "corels/_corels.pyx":85 + /* "corels/_corels.pyx":86 * # This compiles to C, so it's pretty fast! * for s in range(nsamples): * for r in range(n_rules): # <<<<<<<<<<<<<< @@ -2373,7 +2377,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { __pyx_v_r = __pyx_t_13; - /* "corels/_corels.pyx":86 + /* "corels/_corels.pyx":87 * for s in range(nsamples): * for r in range(n_rules): * next_rule = 0 # <<<<<<<<<<<<<< @@ -2382,7 +2386,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * */ __pyx_v_next_rule = 0; - /* "corels/_corels.pyx":87 + /* "corels/_corels.pyx":88 * for r in range(n_rules): * next_rule = 0 * nidx = antecedent_lengths[r] # <<<<<<<<<<<<<< @@ -2391,7 +2395,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * */ __pyx_v_nidx = (__pyx_v_antecedent_lengths[__pyx_v_r]); - /* "corels/_corels.pyx":88 + /* "corels/_corels.pyx":89 * next_rule = 0 * nidx = antecedent_lengths[r] * for a in range(nidx): # <<<<<<<<<<<<<< @@ -2403,7 +2407,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_a = __pyx_t_16; - /* "corels/_corels.pyx":89 + /* "corels/_corels.pyx":90 * nidx = antecedent_lengths[r] * for a in range(nidx): * idx = antecedents[r][a] # <<<<<<<<<<<<<< @@ -2412,7 +2416,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * */ __pyx_v_idx = ((__pyx_v_antecedents[__pyx_v_r])[__pyx_v_a]); - /* "corels/_corels.pyx":90 + /* "corels/_corels.pyx":91 * for a in range(nidx): * idx = antecedents[r][a] * c = 1 # <<<<<<<<<<<<<< @@ -2421,7 +2425,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * */ __pyx_v_c = 1; - /* "corels/_corels.pyx":91 + /* "corels/_corels.pyx":92 * idx = antecedents[r][a] * c = 1 * if idx < 0: # <<<<<<<<<<<<<< @@ -2431,7 +2435,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * __pyx_t_7 = ((__pyx_v_idx < 0) != 0); if (__pyx_t_7) { - /* "corels/_corels.pyx":92 + /* "corels/_corels.pyx":93 * c = 1 * if idx < 0: * idx = -idx # <<<<<<<<<<<<<< @@ -2440,7 +2444,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * */ __pyx_v_idx = (-__pyx_v_idx); - /* "corels/_corels.pyx":93 + /* "corels/_corels.pyx":94 * if idx < 0: * idx = -idx * c = 0 # <<<<<<<<<<<<<< @@ -2449,7 +2453,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * */ __pyx_v_c = 0; - /* "corels/_corels.pyx":91 + /* "corels/_corels.pyx":92 * idx = antecedents[r][a] * c = 1 * if idx < 0: # <<<<<<<<<<<<<< @@ -2458,7 +2462,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * */ } - /* "corels/_corels.pyx":95 + /* "corels/_corels.pyx":96 * c = 0 * * idx = idx - 1 # <<<<<<<<<<<<<< @@ -2467,7 +2471,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * */ __pyx_v_idx = (__pyx_v_idx - 1); - /* "corels/_corels.pyx":96 + /* "corels/_corels.pyx":97 * * idx = idx - 1 * if idx >= nfeatures or X[s, idx] != c: # <<<<<<<<<<<<<< @@ -2487,7 +2491,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * __pyx_L16_bool_binop_done:; if (__pyx_t_7) { - /* "corels/_corels.pyx":97 + /* "corels/_corels.pyx":98 * idx = idx - 1 * if idx >= nfeatures or X[s, idx] != c: * next_rule = 1 # <<<<<<<<<<<<<< @@ -2496,7 +2500,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * */ __pyx_v_next_rule = 1; - /* "corels/_corels.pyx":98 + /* "corels/_corels.pyx":99 * if idx >= nfeatures or X[s, idx] != c: * next_rule = 1 * break # <<<<<<<<<<<<<< @@ -2505,7 +2509,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * */ goto __pyx_L13_break; - /* "corels/_corels.pyx":96 + /* "corels/_corels.pyx":97 * * idx = idx - 1 * if idx >= nfeatures or X[s, idx] != c: # <<<<<<<<<<<<<< @@ -2516,7 +2520,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * } __pyx_L13_break:; - /* "corels/_corels.pyx":100 + /* "corels/_corels.pyx":101 * break * * if next_rule == 0: # <<<<<<<<<<<<<< @@ -2526,19 +2530,19 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * __pyx_t_7 = ((__pyx_v_next_rule == 0) != 0); if (__pyx_t_7) { - /* "corels/_corels.pyx":101 + /* "corels/_corels.pyx":102 * * if next_rule == 0: * out[s] = predictions[r]; # <<<<<<<<<<<<<< * break * */ - __pyx_t_5 = __Pyx_PyInt_From_int((__pyx_v_predictions[__pyx_v_r])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 101, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int((__pyx_v_predictions[__pyx_v_r])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_out), __pyx_v_s, __pyx_t_5, int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0)) __PYX_ERR(0, 101, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_out), __pyx_v_s, __pyx_t_5, int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "corels/_corels.pyx":102 + /* "corels/_corels.pyx":103 * if next_rule == 0: * out[s] = predictions[r]; * break # <<<<<<<<<<<<<< @@ -2547,7 +2551,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * */ goto __pyx_L11_break; - /* "corels/_corels.pyx":100 + /* "corels/_corels.pyx":101 * break * * if next_rule == 0: # <<<<<<<<<<<<<< @@ -2558,7 +2562,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * } __pyx_L11_break:; - /* "corels/_corels.pyx":104 + /* "corels/_corels.pyx":105 * break * * if next_rule == 1: # <<<<<<<<<<<<<< @@ -2568,19 +2572,19 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * __pyx_t_7 = ((__pyx_v_next_rule == 1) != 0); if (__pyx_t_7) { - /* "corels/_corels.pyx":105 + /* "corels/_corels.pyx":106 * * if next_rule == 1: * out[s] = default # <<<<<<<<<<<<<< * * for r in range(n_rules): */ - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_default); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 105, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_default); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_out), __pyx_v_s, __pyx_t_5, int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0)) __PYX_ERR(0, 105, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_out), __pyx_v_s, __pyx_t_5, int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "corels/_corels.pyx":104 + /* "corels/_corels.pyx":105 * break * * if next_rule == 1: # <<<<<<<<<<<<<< @@ -2590,7 +2594,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * } } - /* "corels/_corels.pyx":107 + /* "corels/_corels.pyx":108 * out[s] = default * * for r in range(n_rules): # <<<<<<<<<<<<<< @@ -2602,7 +2606,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_r = __pyx_t_10; - /* "corels/_corels.pyx":108 + /* "corels/_corels.pyx":109 * * for r in range(n_rules): * free(antecedents[r]) # <<<<<<<<<<<<<< @@ -2612,7 +2616,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * free((__pyx_v_antecedents[__pyx_v_r])); } - /* "corels/_corels.pyx":109 + /* "corels/_corels.pyx":110 * for r in range(n_rules): * free(antecedents[r]) * free(antecedents) # <<<<<<<<<<<<<< @@ -2621,7 +2625,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * */ free(__pyx_v_antecedents); - /* "corels/_corels.pyx":110 + /* "corels/_corels.pyx":111 * free(antecedents[r]) * free(antecedents) * free(predictions) # <<<<<<<<<<<<<< @@ -2630,7 +2634,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * */ free(__pyx_v_predictions); - /* "corels/_corels.pyx":111 + /* "corels/_corels.pyx":112 * free(antecedents) * free(predictions) * free(antecedent_lengths) # <<<<<<<<<<<<<< @@ -2639,7 +2643,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * */ free(__pyx_v_antecedent_lengths); - /* "corels/_corels.pyx":113 + /* "corels/_corels.pyx":114 * free(antecedent_lengths) * * return out # <<<<<<<<<<<<<< @@ -2651,7 +2655,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * __pyx_r = ((PyObject *)__pyx_v_out); goto __pyx_L0; - /* "corels/_corels.pyx":60 + /* "corels/_corels.pyx":61 * @cython.boundscheck(False) * @cython.wraparound(False) * def predict_wrap(np.ndarray[np.uint8_t, ndim=2] X, rules): # <<<<<<<<<<<<<< @@ -2684,7 +2688,7 @@ static PyObject *__pyx_pf_6corels_7_corels_predict_wrap(CYTHON_UNUSED PyObject * return __pyx_r; } -/* "corels/_corels.pyx":115 +/* "corels/_corels.pyx":116 * return out * * cdef rule_t* _to_vector(np.ndarray[np.uint8_t, ndim=2] X, int* ncount_out): # <<<<<<<<<<<<<< @@ -2728,23 +2732,23 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int __pyx_pybuffernd_X.rcbuffer = &__pyx_pybuffer_X; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_X.rcbuffer->pybuffer, (PyObject*)__pyx_v_X, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 115, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_X.rcbuffer->pybuffer, (PyObject*)__pyx_v_X, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 116, __pyx_L1_error) } __pyx_pybuffernd_X.diminfo[0].strides = __pyx_pybuffernd_X.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_X.diminfo[0].shape = __pyx_pybuffernd_X.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_X.diminfo[1].strides = __pyx_pybuffernd_X.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_X.diminfo[1].shape = __pyx_pybuffernd_X.rcbuffer->pybuffer.shape[1]; - /* "corels/_corels.pyx":116 + /* "corels/_corels.pyx":117 * * cdef rule_t* _to_vector(np.ndarray[np.uint8_t, ndim=2] X, int* ncount_out): * d0 = X.shape[0] # <<<<<<<<<<<<<< * d1 = X.shape[1] * cdef rule_t* vectors = malloc(d0 * sizeof(rule_t)) */ - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_X->dimensions[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_X->dimensions[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_d0 = __pyx_t_1; __pyx_t_1 = 0; - /* "corels/_corels.pyx":117 + /* "corels/_corels.pyx":118 * cdef rule_t* _to_vector(np.ndarray[np.uint8_t, ndim=2] X, int* ncount_out): * d0 = X.shape[0] * d1 = X.shape[1] # <<<<<<<<<<<<<< @@ -2753,23 +2757,23 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int */ __pyx_v_d1 = (__pyx_v_X->dimensions[1]); - /* "corels/_corels.pyx":118 + /* "corels/_corels.pyx":119 * d0 = X.shape[0] * d1 = X.shape[1] * cdef rule_t* vectors = malloc(d0 * sizeof(rule_t)) # <<<<<<<<<<<<<< * if vectors == NULL: * raise MemoryError() */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t((sizeof(rule_t))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t((sizeof(rule_t))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Multiply(__pyx_v_d0, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_t_2 = PyNumber_Multiply(__pyx_v_d0, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_vectors = ((rule_t *)malloc(__pyx_t_3)); - /* "corels/_corels.pyx":119 + /* "corels/_corels.pyx":120 * d1 = X.shape[1] * cdef rule_t* vectors = malloc(d0 * sizeof(rule_t)) * if vectors == NULL: # <<<<<<<<<<<<<< @@ -2779,16 +2783,16 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int __pyx_t_4 = ((__pyx_v_vectors == NULL) != 0); if (unlikely(__pyx_t_4)) { - /* "corels/_corels.pyx":120 + /* "corels/_corels.pyx":121 * cdef rule_t* vectors = malloc(d0 * sizeof(rule_t)) * if vectors == NULL: * raise MemoryError() # <<<<<<<<<<<<<< * * cdef int nones, ncount; */ - PyErr_NoMemory(); __PYX_ERR(0, 120, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(0, 121, __pyx_L1_error) - /* "corels/_corels.pyx":119 + /* "corels/_corels.pyx":120 * d1 = X.shape[1] * cdef rule_t* vectors = malloc(d0 * sizeof(rule_t)) * if vectors == NULL: # <<<<<<<<<<<<<< @@ -2797,22 +2801,22 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int */ } - /* "corels/_corels.pyx":124 + /* "corels/_corels.pyx":125 * cdef int nones, ncount; * * for i in range(d0): # <<<<<<<<<<<<<< * arrstr = "" * for j in range(d1): */ - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_d0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_d0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 124, __pyx_L1_error) + __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 125, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -2820,17 +2824,17 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 124, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 125, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 124, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 125, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -2840,7 +2844,7 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 124, __pyx_L1_error) + else __PYX_ERR(0, 125, __pyx_L1_error) } break; } @@ -2849,7 +2853,7 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; - /* "corels/_corels.pyx":125 + /* "corels/_corels.pyx":126 * * for i in range(d0): * arrstr = "" # <<<<<<<<<<<<<< @@ -2859,25 +2863,25 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int __Pyx_INCREF(__pyx_kp_u_); __Pyx_XDECREF_SET(__pyx_v_arrstr, __pyx_kp_u_); - /* "corels/_corels.pyx":126 + /* "corels/_corels.pyx":127 * for i in range(d0): * arrstr = "" * for j in range(d1): # <<<<<<<<<<<<<< * if X[i][j]: * arrstr += "1" */ - __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_d1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_d1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 126, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) { __pyx_t_2 = __pyx_t_7; __Pyx_INCREF(__pyx_t_2); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 126, __pyx_L1_error) + __pyx_t_9 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 127, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; for (;;) { @@ -2885,17 +2889,17 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 126, __pyx_L1_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 127, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 126, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 126, __pyx_L1_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 127, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 126, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -2905,7 +2909,7 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 126, __pyx_L1_error) + else __PYX_ERR(0, 127, __pyx_L1_error) } break; } @@ -2914,35 +2918,35 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_7); __pyx_t_7 = 0; - /* "corels/_corels.pyx":127 + /* "corels/_corels.pyx":128 * arrstr = "" * for j in range(d1): * if X[i][j]: # <<<<<<<<<<<<<< * arrstr += "1" * else: */ - __pyx_t_7 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_X), __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_X), __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_v_j); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_v_j); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_4) { - /* "corels/_corels.pyx":128 + /* "corels/_corels.pyx":129 * for j in range(d1): * if X[i][j]: * arrstr += "1" # <<<<<<<<<<<<<< * else: * arrstr += "0" */ - __pyx_t_10 = __Pyx_PyUnicode_Concat(__pyx_v_arrstr, __pyx_kp_u_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 128, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyUnicode_Concat(__pyx_v_arrstr, __pyx_kp_u_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF_SET(__pyx_v_arrstr, ((PyObject*)__pyx_t_10)); __pyx_t_10 = 0; - /* "corels/_corels.pyx":127 + /* "corels/_corels.pyx":128 * arrstr = "" * for j in range(d1): * if X[i][j]: # <<<<<<<<<<<<<< @@ -2952,7 +2956,7 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int goto __pyx_L8; } - /* "corels/_corels.pyx":130 + /* "corels/_corels.pyx":131 * arrstr += "1" * else: * arrstr += "0" # <<<<<<<<<<<<<< @@ -2960,14 +2964,14 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int * bytestr = arrstr.encode("ascii") */ /*else*/ { - __pyx_t_10 = __Pyx_PyUnicode_Concat(__pyx_v_arrstr, __pyx_kp_u_0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 130, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyUnicode_Concat(__pyx_v_arrstr, __pyx_kp_u_0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF_SET(__pyx_v_arrstr, ((PyObject*)__pyx_t_10)); __pyx_t_10 = 0; } __pyx_L8:; - /* "corels/_corels.pyx":126 + /* "corels/_corels.pyx":127 * for i in range(d0): * arrstr = "" * for j in range(d1): # <<<<<<<<<<<<<< @@ -2977,56 +2981,56 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "corels/_corels.pyx":132 + /* "corels/_corels.pyx":133 * arrstr += "0" * * bytestr = arrstr.encode("ascii") # <<<<<<<<<<<<<< * ncount = len(bytestr) * if ascii_to_vector(bytestr, ncount, &ncount, &nones, &vectors[i].truthtable) != 0: */ - __pyx_t_2 = PyUnicode_AsASCIIString(__pyx_v_arrstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error) + __pyx_t_2 = PyUnicode_AsASCIIString(__pyx_v_arrstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_bytestr, __pyx_t_2); __pyx_t_2 = 0; - /* "corels/_corels.pyx":133 + /* "corels/_corels.pyx":134 * * bytestr = arrstr.encode("ascii") * ncount = len(bytestr) # <<<<<<<<<<<<<< * if ascii_to_vector(bytestr, ncount, &ncount, &nones, &vectors[i].truthtable) != 0: * for j in range(i): */ - __pyx_t_8 = PyObject_Length(__pyx_v_bytestr); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 133, __pyx_L1_error) + __pyx_t_8 = PyObject_Length(__pyx_v_bytestr); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 134, __pyx_L1_error) __pyx_v_ncount = __pyx_t_8; - /* "corels/_corels.pyx":134 + /* "corels/_corels.pyx":135 * bytestr = arrstr.encode("ascii") * ncount = len(bytestr) * if ascii_to_vector(bytestr, ncount, &ncount, &nones, &vectors[i].truthtable) != 0: # <<<<<<<<<<<<<< * for j in range(i): * rule_vfree(&vectors[j].truthtable) */ - __pyx_t_11 = __Pyx_PyObject_AsWritableString(__pyx_v_bytestr); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_AsWritableString(__pyx_v_bytestr); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 135, __pyx_L1_error) __pyx_t_4 = ((ascii_to_vector(__pyx_t_11, __pyx_v_ncount, (&__pyx_v_ncount), (&__pyx_v_nones), (&(__pyx_v_vectors[__pyx_t_8]).truthtable)) != 0) != 0); if (__pyx_t_4) { - /* "corels/_corels.pyx":135 + /* "corels/_corels.pyx":136 * ncount = len(bytestr) * if ascii_to_vector(bytestr, ncount, &ncount, &nones, &vectors[i].truthtable) != 0: * for j in range(i): # <<<<<<<<<<<<<< * rule_vfree(&vectors[j].truthtable) * */ - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_10 = __pyx_t_2; __Pyx_INCREF(__pyx_t_10); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = Py_TYPE(__pyx_t_10)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_9 = Py_TYPE(__pyx_t_10)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 136, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -3034,17 +3038,17 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int if (likely(PyList_CheckExact(__pyx_t_10))) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_10)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 136, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_10, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_10, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_10)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 136, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_10, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_10, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -3054,7 +3058,7 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 135, __pyx_L1_error) + else __PYX_ERR(0, 136, __pyx_L1_error) } break; } @@ -3063,17 +3067,17 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_2); __pyx_t_2 = 0; - /* "corels/_corels.pyx":136 + /* "corels/_corels.pyx":137 * if ascii_to_vector(bytestr, ncount, &ncount, &nones, &vectors[i].truthtable) != 0: * for j in range(i): * rule_vfree(&vectors[j].truthtable) # <<<<<<<<<<<<<< * * free(vectors) */ - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_v_j); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_v_j); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 137, __pyx_L1_error) (void)(rule_vfree((&(__pyx_v_vectors[__pyx_t_12]).truthtable))); - /* "corels/_corels.pyx":135 + /* "corels/_corels.pyx":136 * ncount = len(bytestr) * if ascii_to_vector(bytestr, ncount, &ncount, &nones, &vectors[i].truthtable) != 0: * for j in range(i): # <<<<<<<<<<<<<< @@ -3083,7 +3087,7 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "corels/_corels.pyx":138 + /* "corels/_corels.pyx":139 * rule_vfree(&vectors[j].truthtable) * * free(vectors) # <<<<<<<<<<<<<< @@ -3092,20 +3096,20 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int */ free(__pyx_v_vectors); - /* "corels/_corels.pyx":139 + /* "corels/_corels.pyx":140 * * free(vectors) * raise ValueError("Could not load samples") # <<<<<<<<<<<<<< * * ncount_out[0] = ncount */ - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_Raise(__pyx_t_10, 0, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __PYX_ERR(0, 139, __pyx_L1_error) + __PYX_ERR(0, 140, __pyx_L1_error) - /* "corels/_corels.pyx":134 + /* "corels/_corels.pyx":135 * bytestr = arrstr.encode("ascii") * ncount = len(bytestr) * if ascii_to_vector(bytestr, ncount, &ncount, &nones, &vectors[i].truthtable) != 0: # <<<<<<<<<<<<<< @@ -3114,7 +3118,7 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int */ } - /* "corels/_corels.pyx":141 + /* "corels/_corels.pyx":142 * raise ValueError("Could not load samples") * * ncount_out[0] = ncount # <<<<<<<<<<<<<< @@ -3123,37 +3127,37 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int */ (__pyx_v_ncount_out[0]) = __pyx_v_ncount; - /* "corels/_corels.pyx":143 + /* "corels/_corels.pyx":144 * ncount_out[0] = ncount * * vectors[i].features = NULL # <<<<<<<<<<<<<< * vectors[i].cardinality = 1 * vectors[i].support = nones */ - __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 144, __pyx_L1_error) (__pyx_v_vectors[__pyx_t_8]).features = NULL; - /* "corels/_corels.pyx":144 + /* "corels/_corels.pyx":145 * * vectors[i].features = NULL * vectors[i].cardinality = 1 # <<<<<<<<<<<<<< * vectors[i].support = nones * */ - __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 145, __pyx_L1_error) (__pyx_v_vectors[__pyx_t_8]).cardinality = 1; - /* "corels/_corels.pyx":145 + /* "corels/_corels.pyx":146 * vectors[i].features = NULL * vectors[i].cardinality = 1 * vectors[i].support = nones # <<<<<<<<<<<<<< * * return vectors */ - __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L1_error) (__pyx_v_vectors[__pyx_t_8]).support = __pyx_v_nones; - /* "corels/_corels.pyx":124 + /* "corels/_corels.pyx":125 * cdef int nones, ncount; * * for i in range(d0): # <<<<<<<<<<<<<< @@ -3163,7 +3167,7 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "corels/_corels.pyx":147 + /* "corels/_corels.pyx":148 * vectors[i].support = nones * * return vectors # <<<<<<<<<<<<<< @@ -3173,7 +3177,7 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int __pyx_r = __pyx_v_vectors; goto __pyx_L0; - /* "corels/_corels.pyx":115 + /* "corels/_corels.pyx":116 * return out * * cdef rule_t* _to_vector(np.ndarray[np.uint8_t, ndim=2] X, int* ncount_out): # <<<<<<<<<<<<<< @@ -3208,7 +3212,7 @@ static rule_t *__pyx_f_6corels_7_corels__to_vector(PyArrayObject *__pyx_v_X, int return __pyx_r; } -/* "corels/_corels.pyx":149 +/* "corels/_corels.pyx":150 * return vectors * * cdef _free_vector(rule_t* vs, int count): # <<<<<<<<<<<<<< @@ -3226,7 +3230,7 @@ static PyObject *__pyx_f_6corels_7_corels__free_vector(rule_t *__pyx_v_vs, int _ int __pyx_t_4; __Pyx_RefNannySetupContext("_free_vector", 0); - /* "corels/_corels.pyx":150 + /* "corels/_corels.pyx":151 * * cdef _free_vector(rule_t* vs, int count): * if vs == NULL: # <<<<<<<<<<<<<< @@ -3236,18 +3240,18 @@ static PyObject *__pyx_f_6corels_7_corels__free_vector(rule_t *__pyx_v_vs, int _ __pyx_t_1 = ((__pyx_v_vs == NULL) != 0); if (__pyx_t_1) { - /* "corels/_corels.pyx":151 + /* "corels/_corels.pyx":152 * cdef _free_vector(rule_t* vs, int count): * if vs == NULL: * return # <<<<<<<<<<<<<< * - * for i in range(count): + * printf("before for loop\n") */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "corels/_corels.pyx":150 + /* "corels/_corels.pyx":151 * * cdef _free_vector(rule_t* vs, int count): * if vs == NULL: # <<<<<<<<<<<<<< @@ -3256,66 +3260,111 @@ static PyObject *__pyx_f_6corels_7_corels__free_vector(rule_t *__pyx_v_vs, int _ */ } - /* "corels/_corels.pyx":153 + /* "corels/_corels.pyx":154 * return * + * printf("before for loop\n") # <<<<<<<<<<<<<< + * for i in range(count): + * printf("before rule_vfree\n") + */ + (void)(printf(((char const *)"before for loop\n"))); + + /* "corels/_corels.pyx":155 + * + * printf("before for loop\n") * for i in range(count): # <<<<<<<<<<<<<< + * printf("before rule_vfree\n") * rule_vfree(&vs[i].truthtable) - * */ __pyx_t_2 = __pyx_v_count; __pyx_t_3 = __pyx_t_2; for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "corels/_corels.pyx":154 + /* "corels/_corels.pyx":156 + * printf("before for loop\n") + * for i in range(count): + * printf("before rule_vfree\n") # <<<<<<<<<<<<<< + * rule_vfree(&vs[i].truthtable) * + */ + (void)(printf(((char const *)"before rule_vfree\n"))); + + /* "corels/_corels.pyx":157 * for i in range(count): + * printf("before rule_vfree\n") * rule_vfree(&vs[i].truthtable) # <<<<<<<<<<<<<< * - * if vs[i].features: + * printf("before vs[i].features\n") */ (void)(rule_vfree((&(__pyx_v_vs[__pyx_v_i]).truthtable))); - /* "corels/_corels.pyx":156 + /* "corels/_corels.pyx":159 * rule_vfree(&vs[i].truthtable) * + * printf("before vs[i].features\n") # <<<<<<<<<<<<<< + * if vs[i].features: + * printf("before free") + */ + (void)(printf(((char const *)"before vs[i].features\n"))); + + /* "corels/_corels.pyx":160 + * + * printf("before vs[i].features\n") * if vs[i].features: # <<<<<<<<<<<<<< + * printf("before free") * free(vs[i].features) - * */ __pyx_t_1 = ((__pyx_v_vs[__pyx_v_i]).features != 0); if (__pyx_t_1) { - /* "corels/_corels.pyx":157 + /* "corels/_corels.pyx":161 + * printf("before vs[i].features\n") + * if vs[i].features: + * printf("before free") # <<<<<<<<<<<<<< + * free(vs[i].features) * + */ + (void)(printf(((char const *)"before free"))); + + /* "corels/_corels.pyx":162 * if vs[i].features: + * printf("before free") * free(vs[i].features) # <<<<<<<<<<<<<< * - * free(vs) + * printf("after for loop\n") */ free((__pyx_v_vs[__pyx_v_i]).features); - /* "corels/_corels.pyx":156 - * rule_vfree(&vs[i].truthtable) + /* "corels/_corels.pyx":160 * + * printf("before vs[i].features\n") * if vs[i].features: # <<<<<<<<<<<<<< + * printf("before free") * free(vs[i].features) - * */ } } - /* "corels/_corels.pyx":159 + /* "corels/_corels.pyx":164 * free(vs[i].features) * + * printf("after for loop\n") # <<<<<<<<<<<<<< + * free(vs) + * + */ + (void)(printf(((char const *)"after for loop\n"))); + + /* "corels/_corels.pyx":165 + * + * printf("after for loop\n") * free(vs) # <<<<<<<<<<<<<< * * cdef rule_t* rules = NULL */ free(__pyx_v_vs); - /* "corels/_corels.pyx":149 + /* "corels/_corels.pyx":150 * return vectors * * cdef _free_vector(rule_t* vs, int count): # <<<<<<<<<<<<<< @@ -3331,7 +3380,7 @@ static PyObject *__pyx_f_6corels_7_corels__free_vector(rule_t *__pyx_v_vs, int _ return __pyx_r; } -/* "corels/_corels.pyx":171 +/* "corels/_corels.pyx":177 * cdef set[string] run_verbosity * * def fit_wrap_begin(np.ndarray[np.uint8_t, ndim=2] samples, # <<<<<<<<<<<<<< @@ -3359,6 +3408,9 @@ static PyObject *__pyx_pw_6corels_7_corels_3fit_wrap_begin(PyObject *__pyx_self, int __pyx_v_pre_mine; int __pyx_v_num_threads; int __pyx_v_max_num_nodes; + PyArrayObject *__pyx_v_minority_list = 0; + int __pyx_v_random_seed; + int __pyx_v_freq; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -3366,12 +3418,18 @@ static PyObject *__pyx_pw_6corels_7_corels_3fit_wrap_begin(PyObject *__pyx_self, __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fit_wrap_begin (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_samples,&__pyx_n_s_labels,&__pyx_n_s_features,&__pyx_n_s_max_card,&__pyx_n_s_min_support,&__pyx_n_s_verbosity_str,&__pyx_n_s_mine_verbose,&__pyx_n_s_minor_verbose,&__pyx_n_s_c,&__pyx_n_s_policy,&__pyx_n_s_map_type,&__pyx_n_s_ablation,&__pyx_n_s_calculate_size,&__pyx_n_s_pre_mine,&__pyx_n_s_num_threads,&__pyx_n_s_max_num_nodes,0}; - PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_samples,&__pyx_n_s_labels,&__pyx_n_s_features,&__pyx_n_s_max_card,&__pyx_n_s_min_support,&__pyx_n_s_verbosity_str,&__pyx_n_s_mine_verbose,&__pyx_n_s_minor_verbose,&__pyx_n_s_c,&__pyx_n_s_policy,&__pyx_n_s_map_type,&__pyx_n_s_ablation,&__pyx_n_s_calculate_size,&__pyx_n_s_pre_mine,&__pyx_n_s_num_threads,&__pyx_n_s_max_num_nodes,&__pyx_n_s_minority_list,&__pyx_n_s_random_seed,&__pyx_n_s_freq,0}; + PyObject* values[19] = {0,0,0,0,0,0,0,0,0,0,0,0,0,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 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18); + CYTHON_FALLTHROUGH; + case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17); + CYTHON_FALLTHROUGH; + case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16); + CYTHON_FALLTHROUGH; case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15); CYTHON_FALLTHROUGH; case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14); @@ -3416,97 +3474,115 @@ static PyObject *__pyx_pw_6corels_7_corels_3fit_wrap_begin(PyObject *__pyx_self, case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_labels)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 16, 16, 1); __PYX_ERR(0, 171, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 19, 19, 1); __PYX_ERR(0, 177, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_features)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 16, 16, 2); __PYX_ERR(0, 171, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 19, 19, 2); __PYX_ERR(0, 177, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_card)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 16, 16, 3); __PYX_ERR(0, 171, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 19, 19, 3); __PYX_ERR(0, 177, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_support)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 16, 16, 4); __PYX_ERR(0, 171, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 19, 19, 4); __PYX_ERR(0, 177, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_verbosity_str)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 16, 16, 5); __PYX_ERR(0, 171, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 19, 19, 5); __PYX_ERR(0, 177, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mine_verbose)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 16, 16, 6); __PYX_ERR(0, 171, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 19, 19, 6); __PYX_ERR(0, 177, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minor_verbose)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 16, 16, 7); __PYX_ERR(0, 171, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 19, 19, 7); __PYX_ERR(0, 177, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 8: if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_c)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 16, 16, 8); __PYX_ERR(0, 171, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 19, 19, 8); __PYX_ERR(0, 177, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 9: if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_policy)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 16, 16, 9); __PYX_ERR(0, 171, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 19, 19, 9); __PYX_ERR(0, 177, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 10: if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_map_type)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 16, 16, 10); __PYX_ERR(0, 171, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 19, 19, 10); __PYX_ERR(0, 177, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 11: if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ablation)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 16, 16, 11); __PYX_ERR(0, 171, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 19, 19, 11); __PYX_ERR(0, 177, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 12: if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_calculate_size)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 16, 16, 12); __PYX_ERR(0, 171, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 19, 19, 12); __PYX_ERR(0, 177, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 13: if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pre_mine)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 16, 16, 13); __PYX_ERR(0, 171, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 19, 19, 13); __PYX_ERR(0, 177, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 14: if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_threads)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 16, 16, 14); __PYX_ERR(0, 171, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 19, 19, 14); __PYX_ERR(0, 177, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 15: if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_num_nodes)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 16, 16, 15); __PYX_ERR(0, 171, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 19, 19, 15); __PYX_ERR(0, 177, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 16: + if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minority_list)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 19, 19, 16); __PYX_ERR(0, 177, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 17: + if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_random_seed)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 19, 19, 17); __PYX_ERR(0, 177, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 18: + if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_freq)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 19, 19, 18); __PYX_ERR(0, 177, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fit_wrap_begin") < 0)) __PYX_ERR(0, 171, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fit_wrap_begin") < 0)) __PYX_ERR(0, 177, __pyx_L3_error) } - } else if (PyTuple_GET_SIZE(__pyx_args) != 16) { + } else if (PyTuple_GET_SIZE(__pyx_args) != 19) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); @@ -3525,35 +3601,42 @@ static PyObject *__pyx_pw_6corels_7_corels_3fit_wrap_begin(PyObject *__pyx_self, values[13] = PyTuple_GET_ITEM(__pyx_args, 13); values[14] = PyTuple_GET_ITEM(__pyx_args, 14); values[15] = PyTuple_GET_ITEM(__pyx_args, 15); + values[16] = PyTuple_GET_ITEM(__pyx_args, 16); + values[17] = PyTuple_GET_ITEM(__pyx_args, 17); + values[18] = PyTuple_GET_ITEM(__pyx_args, 18); } __pyx_v_samples = ((PyArrayObject *)values[0]); __pyx_v_labels = ((PyArrayObject *)values[1]); __pyx_v_features = values[2]; - __pyx_v_max_card = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_max_card == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 173, __pyx_L3_error) - __pyx_v_min_support = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_min_support == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 173, __pyx_L3_error) + __pyx_v_max_card = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_max_card == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 179, __pyx_L3_error) + __pyx_v_min_support = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_min_support == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 179, __pyx_L3_error) __pyx_v_verbosity_str = values[5]; - __pyx_v_mine_verbose = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_mine_verbose == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 173, __pyx_L3_error) - __pyx_v_minor_verbose = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_minor_verbose == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 174, __pyx_L3_error) - __pyx_v_c = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_c == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 174, __pyx_L3_error) - __pyx_v_policy = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 174, __pyx_L3_error) - __pyx_v_map_type = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_map_type == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 174, __pyx_L3_error) - __pyx_v_ablation = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_ablation == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 174, __pyx_L3_error) - __pyx_v_calculate_size = __Pyx_PyInt_As_int(values[12]); if (unlikely((__pyx_v_calculate_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L3_error) - __pyx_v_pre_mine = __Pyx_PyInt_As_int(values[13]); if (unlikely((__pyx_v_pre_mine == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L3_error) - __pyx_v_num_threads = __Pyx_PyInt_As_int(values[14]); if (unlikely((__pyx_v_num_threads == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L3_error) - __pyx_v_max_num_nodes = __Pyx_PyInt_As_int(values[15]); if (unlikely((__pyx_v_max_num_nodes == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L3_error) + __pyx_v_mine_verbose = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_mine_verbose == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 179, __pyx_L3_error) + __pyx_v_minor_verbose = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_minor_verbose == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 180, __pyx_L3_error) + __pyx_v_c = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_c == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 180, __pyx_L3_error) + __pyx_v_policy = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 180, __pyx_L3_error) + __pyx_v_map_type = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_map_type == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 180, __pyx_L3_error) + __pyx_v_ablation = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_ablation == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 180, __pyx_L3_error) + __pyx_v_calculate_size = __Pyx_PyInt_As_int(values[12]); if (unlikely((__pyx_v_calculate_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L3_error) + __pyx_v_pre_mine = __Pyx_PyInt_As_int(values[13]); if (unlikely((__pyx_v_pre_mine == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L3_error) + __pyx_v_num_threads = __Pyx_PyInt_As_int(values[14]); if (unlikely((__pyx_v_num_threads == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L3_error) + __pyx_v_max_num_nodes = __Pyx_PyInt_As_int(values[15]); if (unlikely((__pyx_v_max_num_nodes == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L3_error) + __pyx_v_minority_list = ((PyArrayObject *)values[16]); + __pyx_v_random_seed = __Pyx_PyInt_As_int(values[17]); if (unlikely((__pyx_v_random_seed == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L3_error) + __pyx_v_freq = __Pyx_PyInt_As_int(values[18]); if (unlikely((__pyx_v_freq == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 16, 16, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 171, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fit_wrap_begin", 1, 19, 19, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 177, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("corels._corels.fit_wrap_begin", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_samples), __pyx_ptype_5numpy_ndarray, 1, "samples", 0))) __PYX_ERR(0, 171, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 172, __pyx_L1_error) - __pyx_r = __pyx_pf_6corels_7_corels_2fit_wrap_begin(__pyx_self, __pyx_v_samples, __pyx_v_labels, __pyx_v_features, __pyx_v_max_card, __pyx_v_min_support, __pyx_v_verbosity_str, __pyx_v_mine_verbose, __pyx_v_minor_verbose, __pyx_v_c, __pyx_v_policy, __pyx_v_map_type, __pyx_v_ablation, __pyx_v_calculate_size, __pyx_v_pre_mine, __pyx_v_num_threads, __pyx_v_max_num_nodes); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_samples), __pyx_ptype_5numpy_ndarray, 1, "samples", 0))) __PYX_ERR(0, 177, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(0, 178, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_minority_list), __pyx_ptype_5numpy_ndarray, 1, "minority_list", 0))) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_r = __pyx_pf_6corels_7_corels_2fit_wrap_begin(__pyx_self, __pyx_v_samples, __pyx_v_labels, __pyx_v_features, __pyx_v_max_card, __pyx_v_min_support, __pyx_v_verbosity_str, __pyx_v_mine_verbose, __pyx_v_minor_verbose, __pyx_v_c, __pyx_v_policy, __pyx_v_map_type, __pyx_v_ablation, __pyx_v_calculate_size, __pyx_v_pre_mine, __pyx_v_num_threads, __pyx_v_max_num_nodes, __pyx_v_minority_list, __pyx_v_random_seed, __pyx_v_freq); /* function exit code */ goto __pyx_L0; @@ -3564,7 +3647,7 @@ static PyObject *__pyx_pw_6corels_7_corels_3fit_wrap_begin(PyObject *__pyx_self, return __pyx_r; } -static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_samples, PyArrayObject *__pyx_v_labels, PyObject *__pyx_v_features, int __pyx_v_max_card, double __pyx_v_min_support, PyObject *__pyx_v_verbosity_str, int __pyx_v_mine_verbose, int __pyx_v_minor_verbose, double __pyx_v_c, int __pyx_v_policy, int __pyx_v_map_type, int __pyx_v_ablation, int __pyx_v_calculate_size, int __pyx_v_pre_mine, int __pyx_v_num_threads, int __pyx_v_max_num_nodes) { +static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_samples, PyArrayObject *__pyx_v_labels, PyObject *__pyx_v_features, int __pyx_v_max_card, double __pyx_v_min_support, PyObject *__pyx_v_verbosity_str, int __pyx_v_mine_verbose, int __pyx_v_minor_verbose, double __pyx_v_c, int __pyx_v_policy, int __pyx_v_map_type, int __pyx_v_ablation, int __pyx_v_calculate_size, int __pyx_v_pre_mine, int __pyx_v_num_threads, int __pyx_v_max_num_nodes, PyArrayObject *__pyx_v_minority_list, int __pyx_v_random_seed, int __pyx_v_freq) { int __pyx_v_nfeatures; rule_t *__pyx_v_samples_vecs; PyObject *__pyx_v_nsamples = NULL; @@ -3577,13 +3660,14 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec char *__pyx_v_verbosity; int __pyx_v_nsamples_chk; int __pyx_v_minor_count; - int __pyx_v_mr; std::vector __pyx_v_rulelist; std::vector __pyx_v_classes; double __pyx_v_rb; PyObject *__pyx_v_r_out = NULL; __Pyx_LocalBuf_ND __pyx_pybuffernd_labels; __Pyx_Buffer __pyx_pybuffer_labels; + __Pyx_LocalBuf_ND __pyx_pybuffernd_minority_list; + __Pyx_Buffer __pyx_pybuffer_minority_list; __Pyx_LocalBuf_ND __pyx_pybuffernd_samples; __Pyx_Buffer __pyx_pybuffer_samples; PyObject *__pyx_r = NULL; @@ -3619,28 +3703,64 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_pybuffer_labels.refcount = 0; __pyx_pybuffernd_labels.data = NULL; __pyx_pybuffernd_labels.rcbuffer = &__pyx_pybuffer_labels; + __pyx_pybuffer_minority_list.pybuffer.buf = NULL; + __pyx_pybuffer_minority_list.refcount = 0; + __pyx_pybuffernd_minority_list.data = NULL; + __pyx_pybuffernd_minority_list.rcbuffer = &__pyx_pybuffer_minority_list; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_samples.rcbuffer->pybuffer, (PyObject*)__pyx_v_samples, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 171, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_samples.rcbuffer->pybuffer, (PyObject*)__pyx_v_samples, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 177, __pyx_L1_error) } __pyx_pybuffernd_samples.diminfo[0].strides = __pyx_pybuffernd_samples.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_samples.diminfo[0].shape = __pyx_pybuffernd_samples.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_samples.diminfo[1].strides = __pyx_pybuffernd_samples.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_samples.diminfo[1].shape = __pyx_pybuffernd_samples.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 171, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_labels.rcbuffer->pybuffer, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 177, __pyx_L1_error) } __pyx_pybuffernd_labels.diminfo[0].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_labels.diminfo[0].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_labels.diminfo[1].strides = __pyx_pybuffernd_labels.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_labels.diminfo[1].shape = __pyx_pybuffernd_labels.rcbuffer->pybuffer.shape[1]; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_minority_list.rcbuffer->pybuffer, (PyObject*)__pyx_v_minority_list, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 177, __pyx_L1_error) + } + __pyx_pybuffernd_minority_list.diminfo[0].strides = __pyx_pybuffernd_minority_list.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_minority_list.diminfo[0].shape = __pyx_pybuffernd_minority_list.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_minority_list.diminfo[1].strides = __pyx_pybuffernd_minority_list.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_minority_list.diminfo[1].shape = __pyx_pybuffernd_minority_list.rcbuffer->pybuffer.shape[1]; - /* "corels/_corels.pyx":181 + /* "corels/_corels.pyx":188 * global n_rules * + * rules = NULL # <<<<<<<<<<<<<< + * labels_vecs = NULL + * minor = NULL + */ + __pyx_v_6corels_7_corels_rules = NULL; + + /* "corels/_corels.pyx":189 + * + * rules = NULL + * labels_vecs = NULL # <<<<<<<<<<<<<< + * minor = NULL + * cdef int nfeatures = 0 + */ + __pyx_v_6corels_7_corels_labels_vecs = NULL; + + /* "corels/_corels.pyx":190 + * rules = NULL + * labels_vecs = NULL + * minor = NULL # <<<<<<<<<<<<<< + * cdef int nfeatures = 0 + * cdef rule_t* samples_vecs = _to_vector(samples, &nfeatures) + */ + __pyx_v_6corels_7_corels_minor = NULL; + + /* "corels/_corels.pyx":191 + * labels_vecs = NULL + * minor = NULL * cdef int nfeatures = 0 # <<<<<<<<<<<<<< * cdef rule_t* samples_vecs = _to_vector(samples, &nfeatures) * */ __pyx_v_nfeatures = 0; - /* "corels/_corels.pyx":182 - * + /* "corels/_corels.pyx":192 + * minor = NULL * cdef int nfeatures = 0 * cdef rule_t* samples_vecs = _to_vector(samples, &nfeatures) # <<<<<<<<<<<<<< * @@ -3648,30 +3768,30 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_samples_vecs = __pyx_f_6corels_7_corels__to_vector(((PyArrayObject *)__pyx_v_samples), (&__pyx_v_nfeatures)); - /* "corels/_corels.pyx":184 + /* "corels/_corels.pyx":194 * cdef rule_t* samples_vecs = _to_vector(samples, &nfeatures) * * nsamples = samples.shape[0] # <<<<<<<<<<<<<< * * if nfeatures > len(features): */ - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_samples->dimensions[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_samples->dimensions[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_nsamples = __pyx_t_1; __pyx_t_1 = 0; - /* "corels/_corels.pyx":186 + /* "corels/_corels.pyx":196 * nsamples = samples.shape[0] * * if nfeatures > len(features): # <<<<<<<<<<<<<< * if samples_vecs != NULL: * _free_vector(samples_vecs, nsamples) */ - __pyx_t_2 = PyObject_Length(__pyx_v_features); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 186, __pyx_L1_error) + __pyx_t_2 = PyObject_Length(__pyx_v_features); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 196, __pyx_L1_error) __pyx_t_3 = ((__pyx_v_nfeatures > __pyx_t_2) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":187 + /* "corels/_corels.pyx":197 * * if nfeatures > len(features): * if samples_vecs != NULL: # <<<<<<<<<<<<<< @@ -3681,19 +3801,19 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = ((__pyx_v_samples_vecs != NULL) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":188 + /* "corels/_corels.pyx":198 * if nfeatures > len(features): * if samples_vecs != NULL: * _free_vector(samples_vecs, nsamples) # <<<<<<<<<<<<<< * samples_vecs = NULL * raise ValueError("Feature count mismatch between sample data (" + str(nfeatures) + */ - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_nsamples); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 188, __pyx_L1_error) - __pyx_t_1 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_samples_vecs, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_nsamples); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 198, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_samples_vecs, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "corels/_corels.pyx":189 + /* "corels/_corels.pyx":199 * if samples_vecs != NULL: * _free_vector(samples_vecs, nsamples) * samples_vecs = NULL # <<<<<<<<<<<<<< @@ -3702,7 +3822,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_samples_vecs = NULL; - /* "corels/_corels.pyx":187 + /* "corels/_corels.pyx":197 * * if nfeatures > len(features): * if samples_vecs != NULL: # <<<<<<<<<<<<<< @@ -3711,61 +3831,61 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":190 + /* "corels/_corels.pyx":200 * _free_vector(samples_vecs, nsamples) * samples_vecs = NULL * raise ValueError("Feature count mismatch between sample data (" + str(nfeatures) + # <<<<<<<<<<<<<< * ") and feature names (" + str(len(features)) + ")") * */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nfeatures); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nfeatures); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Feature_count_mismatch_between_s, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Feature_count_mismatch_between_s, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_t_1, __pyx_kp_u_and_feature_names); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_t_1, __pyx_kp_u_and_feature_names); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "corels/_corels.pyx":191 + /* "corels/_corels.pyx":201 * samples_vecs = NULL * raise ValueError("Feature count mismatch between sample data (" + str(nfeatures) + * ") and feature names (" + str(len(features)) + ")") # <<<<<<<<<<<<<< * * cdef char** features_vec = malloc(nfeatures * sizeof(char*)) */ - __pyx_t_2 = PyObject_Length(__pyx_v_features); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 191, __pyx_L1_error) - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error) + __pyx_t_2 = PyObject_Length(__pyx_v_features); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 191, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_t_1, __pyx_kp_u__3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 191, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_t_1, __pyx_kp_u__3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "corels/_corels.pyx":190 + /* "corels/_corels.pyx":200 * _free_vector(samples_vecs, nsamples) * samples_vecs = NULL * raise ValueError("Feature count mismatch between sample data (" + str(nfeatures) + # <<<<<<<<<<<<<< * ") and feature names (" + str(len(features)) + ")") * */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 190, __pyx_L1_error) + __PYX_ERR(0, 200, __pyx_L1_error) - /* "corels/_corels.pyx":186 + /* "corels/_corels.pyx":196 * nsamples = samples.shape[0] * * if nfeatures > len(features): # <<<<<<<<<<<<<< @@ -3774,7 +3894,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":193 + /* "corels/_corels.pyx":203 * ") and feature names (" + str(len(features)) + ")") * * cdef char** features_vec = malloc(nfeatures * sizeof(char*)) # <<<<<<<<<<<<<< @@ -3783,7 +3903,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_features_vec = ((char **)malloc((__pyx_v_nfeatures * (sizeof(char *))))); - /* "corels/_corels.pyx":194 + /* "corels/_corels.pyx":204 * * cdef char** features_vec = malloc(nfeatures * sizeof(char*)) * if features_vec == NULL: # <<<<<<<<<<<<<< @@ -3793,7 +3913,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = ((__pyx_v_features_vec == NULL) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":195 + /* "corels/_corels.pyx":205 * cdef char** features_vec = malloc(nfeatures * sizeof(char*)) * if features_vec == NULL: * if samples_vecs != NULL: # <<<<<<<<<<<<<< @@ -3803,19 +3923,19 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = ((__pyx_v_samples_vecs != NULL) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":196 + /* "corels/_corels.pyx":206 * if features_vec == NULL: * if samples_vecs != NULL: * _free_vector(samples_vecs, nsamples) # <<<<<<<<<<<<<< * samples_vecs = NULL * raise MemoryError() */ - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_nsamples); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 196, __pyx_L1_error) - __pyx_t_1 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_samples_vecs, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_nsamples); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_samples_vecs, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "corels/_corels.pyx":197 + /* "corels/_corels.pyx":207 * if samples_vecs != NULL: * _free_vector(samples_vecs, nsamples) * samples_vecs = NULL # <<<<<<<<<<<<<< @@ -3824,7 +3944,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_samples_vecs = NULL; - /* "corels/_corels.pyx":195 + /* "corels/_corels.pyx":205 * cdef char** features_vec = malloc(nfeatures * sizeof(char*)) * if features_vec == NULL: * if samples_vecs != NULL: # <<<<<<<<<<<<<< @@ -3833,16 +3953,16 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":198 + /* "corels/_corels.pyx":208 * _free_vector(samples_vecs, nsamples) * samples_vecs = NULL * raise MemoryError() # <<<<<<<<<<<<<< * * for i in range(nfeatures): */ - PyErr_NoMemory(); __PYX_ERR(0, 198, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(0, 208, __pyx_L1_error) - /* "corels/_corels.pyx":194 + /* "corels/_corels.pyx":204 * * cdef char** features_vec = malloc(nfeatures * sizeof(char*)) * if features_vec == NULL: # <<<<<<<<<<<<<< @@ -3851,7 +3971,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":200 + /* "corels/_corels.pyx":210 * raise MemoryError() * * for i in range(nfeatures): # <<<<<<<<<<<<<< @@ -3863,16 +3983,16 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; - /* "corels/_corels.pyx":201 + /* "corels/_corels.pyx":211 * * for i in range(nfeatures): * bytestr = features[i].encode("ascii") # <<<<<<<<<<<<<< * features_vec[i] = strdup(bytestr) * if features_vec[i] == NULL: */ - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_features, __pyx_v_i, std::vector ::size_type, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_features, __pyx_v_i, std::vector ::size_type, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; @@ -3887,23 +4007,23 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec } __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_u_ascii) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_u_ascii); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_bytestr, __pyx_t_1); __pyx_t_1 = 0; - /* "corels/_corels.pyx":202 + /* "corels/_corels.pyx":212 * for i in range(nfeatures): * bytestr = features[i].encode("ascii") * features_vec[i] = strdup(bytestr) # <<<<<<<<<<<<<< * if features_vec[i] == NULL: * for j in range(i): */ - __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L1_error) (__pyx_v_features_vec[__pyx_v_i]) = strdup(__pyx_t_9); - /* "corels/_corels.pyx":203 + /* "corels/_corels.pyx":213 * bytestr = features[i].encode("ascii") * features_vec[i] = strdup(bytestr) * if features_vec[i] == NULL: # <<<<<<<<<<<<<< @@ -3913,7 +4033,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = (((__pyx_v_features_vec[__pyx_v_i]) == NULL) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":204 + /* "corels/_corels.pyx":214 * features_vec[i] = strdup(bytestr) * if features_vec[i] == NULL: * for j in range(i): # <<<<<<<<<<<<<< @@ -3925,7 +4045,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { __pyx_v_j = __pyx_t_12; - /* "corels/_corels.pyx":205 + /* "corels/_corels.pyx":215 * if features_vec[i] == NULL: * for j in range(i): * if features_vec[j] != NULL: # <<<<<<<<<<<<<< @@ -3935,7 +4055,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = (((__pyx_v_features_vec[__pyx_v_j]) != NULL) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":206 + /* "corels/_corels.pyx":216 * for j in range(i): * if features_vec[j] != NULL: * free(features_vec[j]) # <<<<<<<<<<<<<< @@ -3944,7 +4064,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ free((__pyx_v_features_vec[__pyx_v_j])); - /* "corels/_corels.pyx":205 + /* "corels/_corels.pyx":215 * if features_vec[i] == NULL: * for j in range(i): * if features_vec[j] != NULL: # <<<<<<<<<<<<<< @@ -3954,7 +4074,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec } } - /* "corels/_corels.pyx":207 + /* "corels/_corels.pyx":217 * if features_vec[j] != NULL: * free(features_vec[j]) * features_vec = NULL # <<<<<<<<<<<<<< @@ -3963,7 +4083,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_features_vec = NULL; - /* "corels/_corels.pyx":208 + /* "corels/_corels.pyx":218 * free(features_vec[j]) * features_vec = NULL * if samples_vecs != NULL: # <<<<<<<<<<<<<< @@ -3973,19 +4093,19 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = ((__pyx_v_samples_vecs != NULL) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":209 + /* "corels/_corels.pyx":219 * features_vec = NULL * if samples_vecs != NULL: * _free_vector(samples_vecs, nsamples) # <<<<<<<<<<<<<< * samples_vecs = NULL * raise MemoryError() */ - __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_v_nsamples); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 209, __pyx_L1_error) - __pyx_t_1 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_samples_vecs, __pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_v_nsamples); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 219, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_samples_vecs, __pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "corels/_corels.pyx":210 + /* "corels/_corels.pyx":220 * if samples_vecs != NULL: * _free_vector(samples_vecs, nsamples) * samples_vecs = NULL # <<<<<<<<<<<<<< @@ -3994,7 +4114,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_samples_vecs = NULL; - /* "corels/_corels.pyx":208 + /* "corels/_corels.pyx":218 * free(features_vec[j]) * features_vec = NULL * if samples_vecs != NULL: # <<<<<<<<<<<<<< @@ -4003,16 +4123,16 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":211 + /* "corels/_corels.pyx":221 * _free_vector(samples_vecs, nsamples) * samples_vecs = NULL * raise MemoryError() # <<<<<<<<<<<<<< * * if rules != NULL: */ - PyErr_NoMemory(); __PYX_ERR(0, 211, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(0, 221, __pyx_L1_error) - /* "corels/_corels.pyx":203 + /* "corels/_corels.pyx":213 * bytestr = features[i].encode("ascii") * features_vec[i] = strdup(bytestr) * if features_vec[i] == NULL: # <<<<<<<<<<<<<< @@ -4022,7 +4142,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec } } - /* "corels/_corels.pyx":213 + /* "corels/_corels.pyx":223 * raise MemoryError() * * if rules != NULL: # <<<<<<<<<<<<<< @@ -4032,18 +4152,18 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = ((__pyx_v_6corels_7_corels_rules != NULL) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":214 + /* "corels/_corels.pyx":224 * * if rules != NULL: * _free_vector(rules, n_rules) # <<<<<<<<<<<<<< * rules = NULL * n_rules = 0 */ - __pyx_t_1 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_rules, __pyx_v_6corels_7_corels_n_rules); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_rules, __pyx_v_6corels_7_corels_n_rules); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "corels/_corels.pyx":215 + /* "corels/_corels.pyx":225 * if rules != NULL: * _free_vector(rules, n_rules) * rules = NULL # <<<<<<<<<<<<<< @@ -4052,7 +4172,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_6corels_7_corels_rules = NULL; - /* "corels/_corels.pyx":213 + /* "corels/_corels.pyx":223 * raise MemoryError() * * if rules != NULL: # <<<<<<<<<<<<<< @@ -4061,7 +4181,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":216 + /* "corels/_corels.pyx":226 * _free_vector(rules, n_rules) * rules = NULL * n_rules = 0 # <<<<<<<<<<<<<< @@ -4070,16 +4190,16 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_6corels_7_corels_n_rules = 0; - /* "corels/_corels.pyx":218 + /* "corels/_corels.pyx":228 * n_rules = 0 * * cdef int r = mine_rules(features_vec, samples_vecs, nfeatures, nsamples, # <<<<<<<<<<<<<< * max_card, min_support, &rules, mine_verbose, pre_mine) * */ - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_nsamples); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 218, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_nsamples); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L1_error) - /* "corels/_corels.pyx":219 + /* "corels/_corels.pyx":229 * * cdef int r = mine_rules(features_vec, samples_vecs, nfeatures, nsamples, * max_card, min_support, &rules, mine_verbose, pre_mine) # <<<<<<<<<<<<<< @@ -4088,7 +4208,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_r = mine_rules(__pyx_v_features_vec, __pyx_v_samples_vecs, __pyx_v_nfeatures, __pyx_t_4, __pyx_v_max_card, __pyx_v_min_support, (&__pyx_v_6corels_7_corels_rules), __pyx_v_mine_verbose, __pyx_v_pre_mine); - /* "corels/_corels.pyx":221 + /* "corels/_corels.pyx":231 * max_card, min_support, &rules, mine_verbose, pre_mine) * * if features_vec != NULL: # <<<<<<<<<<<<<< @@ -4098,7 +4218,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = ((__pyx_v_features_vec != NULL) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":222 + /* "corels/_corels.pyx":232 * * if features_vec != NULL: * for i in range(nfeatures): # <<<<<<<<<<<<<< @@ -4110,7 +4230,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; - /* "corels/_corels.pyx":223 + /* "corels/_corels.pyx":233 * if features_vec != NULL: * for i in range(nfeatures): * if features_vec[i] != NULL: # <<<<<<<<<<<<<< @@ -4120,7 +4240,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = (((__pyx_v_features_vec[__pyx_v_i]) != NULL) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":224 + /* "corels/_corels.pyx":234 * for i in range(nfeatures): * if features_vec[i] != NULL: * free(features_vec[i]) # <<<<<<<<<<<<<< @@ -4129,7 +4249,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ free((__pyx_v_features_vec[__pyx_v_i])); - /* "corels/_corels.pyx":223 + /* "corels/_corels.pyx":233 * if features_vec != NULL: * for i in range(nfeatures): * if features_vec[i] != NULL: # <<<<<<<<<<<<<< @@ -4139,7 +4259,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec } } - /* "corels/_corels.pyx":225 + /* "corels/_corels.pyx":235 * if features_vec[i] != NULL: * free(features_vec[i]) * free(features_vec) # <<<<<<<<<<<<<< @@ -4148,7 +4268,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ free(__pyx_v_features_vec); - /* "corels/_corels.pyx":226 + /* "corels/_corels.pyx":236 * free(features_vec[i]) * free(features_vec) * features_vec = NULL # <<<<<<<<<<<<<< @@ -4157,7 +4277,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_features_vec = NULL; - /* "corels/_corels.pyx":221 + /* "corels/_corels.pyx":231 * max_card, min_support, &rules, mine_verbose, pre_mine) * * if features_vec != NULL: # <<<<<<<<<<<<<< @@ -4166,7 +4286,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":228 + /* "corels/_corels.pyx":238 * features_vec = NULL * * if samples_vecs != NULL: # <<<<<<<<<<<<<< @@ -4176,19 +4296,19 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = ((__pyx_v_samples_vecs != NULL) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":229 + /* "corels/_corels.pyx":239 * * if samples_vecs != NULL: * _free_vector(samples_vecs, nsamples) # <<<<<<<<<<<<<< * samples_vecs = NULL * */ - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_nsamples); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 229, __pyx_L1_error) - __pyx_t_1 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_samples_vecs, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_nsamples); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_samples_vecs, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "corels/_corels.pyx":230 + /* "corels/_corels.pyx":240 * if samples_vecs != NULL: * _free_vector(samples_vecs, nsamples) * samples_vecs = NULL # <<<<<<<<<<<<<< @@ -4197,7 +4317,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_samples_vecs = NULL; - /* "corels/_corels.pyx":228 + /* "corels/_corels.pyx":238 * features_vec = NULL * * if samples_vecs != NULL: # <<<<<<<<<<<<<< @@ -4206,7 +4326,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":232 + /* "corels/_corels.pyx":242 * samples_vecs = NULL * * if r == -1 or rules == NULL: # <<<<<<<<<<<<<< @@ -4224,16 +4344,16 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_L21_bool_binop_done:; if (unlikely(__pyx_t_3)) { - /* "corels/_corels.pyx":233 + /* "corels/_corels.pyx":243 * * if r == -1 or rules == NULL: * raise MemoryError(); # <<<<<<<<<<<<<< * * n_rules = r */ - PyErr_NoMemory(); __PYX_ERR(0, 233, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(0, 243, __pyx_L1_error) - /* "corels/_corels.pyx":232 + /* "corels/_corels.pyx":242 * samples_vecs = NULL * * if r == -1 or rules == NULL: # <<<<<<<<<<<<<< @@ -4242,7 +4362,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":235 + /* "corels/_corels.pyx":245 * raise MemoryError(); * * n_rules = r # <<<<<<<<<<<<<< @@ -4251,14 +4371,14 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_6corels_7_corels_n_rules = __pyx_v_r; - /* "corels/_corels.pyx":237 + /* "corels/_corels.pyx":247 * n_rules = r * * verbosity_ascii = verbosity_str.encode("ascii") # <<<<<<<<<<<<<< * cdef char* verbosity = verbosity_ascii * */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_verbosity_str, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_verbosity_str, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { @@ -4272,23 +4392,23 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec } __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_u_ascii) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_u_ascii); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_verbosity_ascii = __pyx_t_1; __pyx_t_1 = 0; - /* "corels/_corels.pyx":238 + /* "corels/_corels.pyx":248 * * verbosity_ascii = verbosity_str.encode("ascii") * cdef char* verbosity = verbosity_ascii # <<<<<<<<<<<<<< * * if labels_vecs != NULL: */ - __pyx_t_15 = __Pyx_PyObject_AsWritableString(__pyx_v_verbosity_ascii); if (unlikely((!__pyx_t_15) && PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_AsWritableString(__pyx_v_verbosity_ascii); if (unlikely((!__pyx_t_15) && PyErr_Occurred())) __PYX_ERR(0, 248, __pyx_L1_error) __pyx_v_verbosity = __pyx_t_15; - /* "corels/_corels.pyx":240 + /* "corels/_corels.pyx":250 * cdef char* verbosity = verbosity_ascii * * if labels_vecs != NULL: # <<<<<<<<<<<<<< @@ -4298,18 +4418,18 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = ((__pyx_v_6corels_7_corels_labels_vecs != NULL) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":241 + /* "corels/_corels.pyx":251 * * if labels_vecs != NULL: * _free_vector(labels_vecs, 2) # <<<<<<<<<<<<<< * labels_vecs = NULL * */ - __pyx_t_1 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_labels_vecs, 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_labels_vecs, 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "corels/_corels.pyx":242 + /* "corels/_corels.pyx":252 * if labels_vecs != NULL: * _free_vector(labels_vecs, 2) * labels_vecs = NULL # <<<<<<<<<<<<<< @@ -4318,7 +4438,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_6corels_7_corels_labels_vecs = NULL; - /* "corels/_corels.pyx":240 + /* "corels/_corels.pyx":250 * cdef char* verbosity = verbosity_ascii * * if labels_vecs != NULL: # <<<<<<<<<<<<<< @@ -4327,7 +4447,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":244 + /* "corels/_corels.pyx":254 * labels_vecs = NULL * * cdef int nsamples_chk = 0 # <<<<<<<<<<<<<< @@ -4336,7 +4456,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_nsamples_chk = 0; - /* "corels/_corels.pyx":245 + /* "corels/_corels.pyx":255 * * cdef int nsamples_chk = 0 * try: # <<<<<<<<<<<<<< @@ -4347,7 +4467,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec (void)__pyx_t_16; (void)__pyx_t_17; (void)__pyx_t_18; /* mark used */ /*try:*/ { - /* "corels/_corels.pyx":246 + /* "corels/_corels.pyx":256 * cdef int nsamples_chk = 0 * try: * labels_vecs = _to_vector(labels, &nsamples_chk) # <<<<<<<<<<<<<< @@ -4356,7 +4476,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_6corels_7_corels_labels_vecs = __pyx_f_6corels_7_corels__to_vector(((PyArrayObject *)__pyx_v_labels), (&__pyx_v_nsamples_chk)); - /* "corels/_corels.pyx":245 + /* "corels/_corels.pyx":255 * * cdef int nsamples_chk = 0 * try: # <<<<<<<<<<<<<< @@ -4366,22 +4486,22 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec } } - /* "corels/_corels.pyx":254 + /* "corels/_corels.pyx":264 * raise * * if nsamples_chk != nsamples: # <<<<<<<<<<<<<< * if labels_vecs != NULL: * _free_vector(labels_vecs, 2) */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nsamples_chk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 254, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nsamples_chk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_v_nsamples, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 254, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_v_nsamples, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 264, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 254, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 264, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_3) { - /* "corels/_corels.pyx":255 + /* "corels/_corels.pyx":265 * * if nsamples_chk != nsamples: * if labels_vecs != NULL: # <<<<<<<<<<<<<< @@ -4391,18 +4511,18 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = ((__pyx_v_6corels_7_corels_labels_vecs != NULL) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":256 + /* "corels/_corels.pyx":266 * if nsamples_chk != nsamples: * if labels_vecs != NULL: * _free_vector(labels_vecs, 2) # <<<<<<<<<<<<<< * labels_vecs = NULL * if rules != NULL: */ - __pyx_t_5 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_labels_vecs, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 256, __pyx_L1_error) + __pyx_t_5 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_labels_vecs, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "corels/_corels.pyx":257 + /* "corels/_corels.pyx":267 * if labels_vecs != NULL: * _free_vector(labels_vecs, 2) * labels_vecs = NULL # <<<<<<<<<<<<<< @@ -4411,7 +4531,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_6corels_7_corels_labels_vecs = NULL; - /* "corels/_corels.pyx":255 + /* "corels/_corels.pyx":265 * * if nsamples_chk != nsamples: * if labels_vecs != NULL: # <<<<<<<<<<<<<< @@ -4420,7 +4540,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":258 + /* "corels/_corels.pyx":268 * _free_vector(labels_vecs, 2) * labels_vecs = NULL * if rules != NULL: # <<<<<<<<<<<<<< @@ -4430,18 +4550,18 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = ((__pyx_v_6corels_7_corels_rules != NULL) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":259 + /* "corels/_corels.pyx":269 * labels_vecs = NULL * if rules != NULL: * _free_vector(rules, n_rules) # <<<<<<<<<<<<<< * rules = NULL * n_rules = 0 */ - __pyx_t_5 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_rules, __pyx_v_6corels_7_corels_n_rules); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 259, __pyx_L1_error) + __pyx_t_5 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_rules, __pyx_v_6corels_7_corels_n_rules); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "corels/_corels.pyx":260 + /* "corels/_corels.pyx":270 * if rules != NULL: * _free_vector(rules, n_rules) * rules = NULL # <<<<<<<<<<<<<< @@ -4450,7 +4570,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_6corels_7_corels_rules = NULL; - /* "corels/_corels.pyx":258 + /* "corels/_corels.pyx":268 * _free_vector(labels_vecs, 2) * labels_vecs = NULL * if rules != NULL: # <<<<<<<<<<<<<< @@ -4459,7 +4579,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":261 + /* "corels/_corels.pyx":271 * _free_vector(rules, n_rules) * rules = NULL * n_rules = 0 # <<<<<<<<<<<<<< @@ -4468,57 +4588,57 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_6corels_7_corels_n_rules = 0; - /* "corels/_corels.pyx":262 + /* "corels/_corels.pyx":272 * rules = NULL * n_rules = 0 * raise ValueError("Sample count mismatch between label (" + str(nsamples_chk) + # <<<<<<<<<<<<<< * ") and rule data (" + str(nsamples) + ")") * */ - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nsamples_chk); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 262, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nsamples_chk); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Sample_count_mismatch_between_la, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 262, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Sample_count_mismatch_between_la, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_t_5, __pyx_kp_u_and_rule_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_t_5, __pyx_kp_u_and_rule_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "corels/_corels.pyx":263 + /* "corels/_corels.pyx":273 * n_rules = 0 * raise ValueError("Sample count mismatch between label (" + str(nsamples_chk) + * ") and rule data (" + str(nsamples) + ")") # <<<<<<<<<<<<<< * * labels_vecs[0].features = malloc(8) */ - __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_nsamples); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 263, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_nsamples); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 263, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_t_6, __pyx_kp_u__3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 263, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_t_6, __pyx_kp_u__3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "corels/_corels.pyx":262 + /* "corels/_corels.pyx":272 * rules = NULL * n_rules = 0 * raise ValueError("Sample count mismatch between label (" + str(nsamples_chk) + # <<<<<<<<<<<<<< * ") and rule data (" + str(nsamples) + ")") * */ - __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 262, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 262, __pyx_L1_error) + __PYX_ERR(0, 272, __pyx_L1_error) - /* "corels/_corels.pyx":254 + /* "corels/_corels.pyx":264 * raise * * if nsamples_chk != nsamples: # <<<<<<<<<<<<<< @@ -4527,7 +4647,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":265 + /* "corels/_corels.pyx":275 * ") and rule data (" + str(nsamples) + ")") * * labels_vecs[0].features = malloc(8) # <<<<<<<<<<<<<< @@ -4536,7 +4656,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ (__pyx_v_6corels_7_corels_labels_vecs[0]).features = ((char *)malloc(8)); - /* "corels/_corels.pyx":266 + /* "corels/_corels.pyx":276 * * labels_vecs[0].features = malloc(8) * labels_vecs[1].features = malloc(8) # <<<<<<<<<<<<<< @@ -4545,7 +4665,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ (__pyx_v_6corels_7_corels_labels_vecs[1]).features = ((char *)malloc(8)); - /* "corels/_corels.pyx":267 + /* "corels/_corels.pyx":277 * labels_vecs[0].features = malloc(8) * labels_vecs[1].features = malloc(8) * if labels_vecs[0].features == NULL or labels_vecs[1].features == NULL: # <<<<<<<<<<<<<< @@ -4563,7 +4683,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_L34_bool_binop_done:; if (__pyx_t_3) { - /* "corels/_corels.pyx":268 + /* "corels/_corels.pyx":278 * labels_vecs[1].features = malloc(8) * if labels_vecs[0].features == NULL or labels_vecs[1].features == NULL: * if labels_vecs != NULL: # <<<<<<<<<<<<<< @@ -4573,18 +4693,18 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = ((__pyx_v_6corels_7_corels_labels_vecs != NULL) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":269 + /* "corels/_corels.pyx":279 * if labels_vecs[0].features == NULL or labels_vecs[1].features == NULL: * if labels_vecs != NULL: * _free_vector(labels_vecs, 2) # <<<<<<<<<<<<<< * labels_vecs = NULL * if rules != NULL: */ - __pyx_t_6 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_labels_vecs, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 269, __pyx_L1_error) + __pyx_t_6 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_labels_vecs, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "corels/_corels.pyx":270 + /* "corels/_corels.pyx":280 * if labels_vecs != NULL: * _free_vector(labels_vecs, 2) * labels_vecs = NULL # <<<<<<<<<<<<<< @@ -4593,7 +4713,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_6corels_7_corels_labels_vecs = NULL; - /* "corels/_corels.pyx":268 + /* "corels/_corels.pyx":278 * labels_vecs[1].features = malloc(8) * if labels_vecs[0].features == NULL or labels_vecs[1].features == NULL: * if labels_vecs != NULL: # <<<<<<<<<<<<<< @@ -4602,7 +4722,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":271 + /* "corels/_corels.pyx":281 * _free_vector(labels_vecs, 2) * labels_vecs = NULL * if rules != NULL: # <<<<<<<<<<<<<< @@ -4612,18 +4732,18 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = ((__pyx_v_6corels_7_corels_rules != NULL) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":272 + /* "corels/_corels.pyx":282 * labels_vecs = NULL * if rules != NULL: * _free_vector(rules, n_rules) # <<<<<<<<<<<<<< * rules = NULL * n_rules = 0 */ - __pyx_t_6 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_rules, __pyx_v_6corels_7_corels_n_rules); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 272, __pyx_L1_error) + __pyx_t_6 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_rules, __pyx_v_6corels_7_corels_n_rules); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "corels/_corels.pyx":273 + /* "corels/_corels.pyx":283 * if rules != NULL: * _free_vector(rules, n_rules) * rules = NULL # <<<<<<<<<<<<<< @@ -4632,7 +4752,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_6corels_7_corels_rules = NULL; - /* "corels/_corels.pyx":271 + /* "corels/_corels.pyx":281 * _free_vector(labels_vecs, 2) * labels_vecs = NULL * if rules != NULL: # <<<<<<<<<<<<<< @@ -4641,7 +4761,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":274 + /* "corels/_corels.pyx":284 * _free_vector(rules, n_rules) * rules = NULL * n_rules = 0 # <<<<<<<<<<<<<< @@ -4650,16 +4770,16 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_6corels_7_corels_n_rules = 0; - /* "corels/_corels.pyx":275 + /* "corels/_corels.pyx":285 * rules = NULL * n_rules = 0 * raise MemoryError(); # <<<<<<<<<<<<<< * strcpy(labels_vecs[0].features, "label=0") * strcpy(labels_vecs[1].features, "label=1") */ - PyErr_NoMemory(); __PYX_ERR(0, 275, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(0, 285, __pyx_L1_error) - /* "corels/_corels.pyx":267 + /* "corels/_corels.pyx":277 * labels_vecs[0].features = malloc(8) * labels_vecs[1].features = malloc(8) * if labels_vecs[0].features == NULL or labels_vecs[1].features == NULL: # <<<<<<<<<<<<<< @@ -4668,7 +4788,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":276 + /* "corels/_corels.pyx":286 * n_rules = 0 * raise MemoryError(); * strcpy(labels_vecs[0].features, "label=0") # <<<<<<<<<<<<<< @@ -4677,7 +4797,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ (void)(strcpy((__pyx_v_6corels_7_corels_labels_vecs[0]).features, ((char const *)"label=0"))); - /* "corels/_corels.pyx":277 + /* "corels/_corels.pyx":287 * raise MemoryError(); * strcpy(labels_vecs[0].features, "label=0") * strcpy(labels_vecs[1].features, "label=1") # <<<<<<<<<<<<<< @@ -4686,7 +4806,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ (void)(strcpy((__pyx_v_6corels_7_corels_labels_vecs[1]).features, ((char const *)"label=1"))); - /* "corels/_corels.pyx":279 + /* "corels/_corels.pyx":289 * strcpy(labels_vecs[1].features, "label=1") * * if minor != NULL: # <<<<<<<<<<<<<< @@ -4696,27 +4816,27 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = ((__pyx_v_6corels_7_corels_minor != NULL) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":280 + /* "corels/_corels.pyx":290 * * if minor != NULL: * _free_vector(minor, 1) # <<<<<<<<<<<<<< * minor = NULL * */ - __pyx_t_6 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_minor, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 280, __pyx_L1_error) + __pyx_t_6 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_minor, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "corels/_corels.pyx":281 + /* "corels/_corels.pyx":291 * if minor != NULL: * _free_vector(minor, 1) * minor = NULL # <<<<<<<<<<<<<< * - * minor = malloc(sizeof(rule_t)) + * cdef int minor_count = 0; */ __pyx_v_6corels_7_corels_minor = NULL; - /* "corels/_corels.pyx":279 + /* "corels/_corels.pyx":289 * strcpy(labels_vecs[1].features, "label=1") * * if minor != NULL: # <<<<<<<<<<<<<< @@ -4725,295 +4845,362 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":283 + /* "corels/_corels.pyx":293 * minor = NULL * - * minor = malloc(sizeof(rule_t)) # <<<<<<<<<<<<<< - * if minor == NULL: - * if labels_vecs != NULL: + * cdef int minor_count = 0; # <<<<<<<<<<<<<< + * if minority_list[0][0] < 0: + * printf("in _to_vector\n") */ - __pyx_v_6corels_7_corels_minor = ((rule_t *)malloc((sizeof(rule_t)))); + __pyx_v_minor_count = 0; - /* "corels/_corels.pyx":284 + /* "corels/_corels.pyx":294 * - * minor = malloc(sizeof(rule_t)) - * if minor == NULL: # <<<<<<<<<<<<<< - * if labels_vecs != NULL: - * _free_vector(labels_vecs, 2) + * cdef int minor_count = 0; + * if minority_list[0][0] < 0: # <<<<<<<<<<<<<< + * printf("in _to_vector\n") + * minor = _to_vector(minority_list, &minor_count) */ - __pyx_t_3 = ((__pyx_v_6corels_7_corels_minor == NULL) != 0); + __pyx_t_6 = __Pyx_GetItemInt(((PyObject *)__pyx_v_minority_list), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 294, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 294, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 294, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 294, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_3) { - /* "corels/_corels.pyx":285 - * minor = malloc(sizeof(rule_t)) - * if minor == NULL: - * if labels_vecs != NULL: # <<<<<<<<<<<<<< - * _free_vector(labels_vecs, 2) - * labels_vecs = NULL + /* "corels/_corels.pyx":295 + * cdef int minor_count = 0; + * if minority_list[0][0] < 0: + * printf("in _to_vector\n") # <<<<<<<<<<<<<< + * minor = _to_vector(minority_list, &minor_count) + * minor.features = malloc(9) */ - __pyx_t_3 = ((__pyx_v_6corels_7_corels_labels_vecs != NULL) != 0); - if (__pyx_t_3) { + (void)(printf(((char const *)"in _to_vector\n"))); - /* "corels/_corels.pyx":286 - * if minor == NULL: - * if labels_vecs != NULL: - * _free_vector(labels_vecs, 2) # <<<<<<<<<<<<<< - * labels_vecs = NULL - * if rules != NULL: + /* "corels/_corels.pyx":296 + * if minority_list[0][0] < 0: + * printf("in _to_vector\n") + * minor = _to_vector(minority_list, &minor_count) # <<<<<<<<<<<<<< + * minor.features = malloc(9) + * strcpy(minor.features, "minority") */ - __pyx_t_6 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_labels_vecs, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 286, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_6corels_7_corels_minor = __pyx_f_6corels_7_corels__to_vector(((PyArrayObject *)__pyx_v_minority_list), (&__pyx_v_minor_count)); - /* "corels/_corels.pyx":287 - * if labels_vecs != NULL: - * _free_vector(labels_vecs, 2) - * labels_vecs = NULL # <<<<<<<<<<<<<< - * if rules != NULL: - * _free_vector(rules, n_rules) + /* "corels/_corels.pyx":297 + * printf("in _to_vector\n") + * minor = _to_vector(minority_list, &minor_count) + * minor.features = malloc(9) # <<<<<<<<<<<<<< + * strcpy(minor.features, "minority") + * printf("minor count is %i\n", minor_count) + */ + __pyx_v_6corels_7_corels_minor->features = ((char *)malloc(9)); + + /* "corels/_corels.pyx":298 + * minor = _to_vector(minority_list, &minor_count) + * minor.features = malloc(9) + * strcpy(minor.features, "minority") # <<<<<<<<<<<<<< + * printf("minor count is %i\n", minor_count) + * else: */ - __pyx_v_6corels_7_corels_labels_vecs = NULL; + (void)(strcpy(__pyx_v_6corels_7_corels_minor->features, ((char const *)"minority"))); - /* "corels/_corels.pyx":285 - * minor = malloc(sizeof(rule_t)) - * if minor == NULL: - * if labels_vecs != NULL: # <<<<<<<<<<<<<< - * _free_vector(labels_vecs, 2) - * labels_vecs = NULL + /* "corels/_corels.pyx":299 + * minor.features = malloc(9) + * strcpy(minor.features, "minority") + * printf("minor count is %i\n", minor_count) # <<<<<<<<<<<<<< + * else: + * minor = malloc(sizeof(rule_t)) */ - } + (void)(printf(((char const *)"minor count is %i\n"), __pyx_v_minor_count)); - /* "corels/_corels.pyx":288 - * _free_vector(labels_vecs, 2) - * labels_vecs = NULL - * if rules != NULL: # <<<<<<<<<<<<<< - * _free_vector(rules, n_rules) - * rules = NULL + /* "corels/_corels.pyx":294 + * + * cdef int minor_count = 0; + * if minority_list[0][0] < 0: # <<<<<<<<<<<<<< + * printf("in _to_vector\n") + * minor = _to_vector(minority_list, &minor_count) */ - __pyx_t_3 = ((__pyx_v_6corels_7_corels_rules != NULL) != 0); + goto __pyx_L39; + } + + /* "corels/_corels.pyx":301 + * printf("minor count is %i\n", minor_count) + * else: + * minor = malloc(sizeof(rule_t)) # <<<<<<<<<<<<<< + * if minor == NULL: + * if labels_vecs != NULL: + */ + /*else*/ { + __pyx_v_6corels_7_corels_minor = ((rule_t *)malloc((sizeof(rule_t)))); + + /* "corels/_corels.pyx":302 + * else: + * minor = malloc(sizeof(rule_t)) + * if minor == NULL: # <<<<<<<<<<<<<< + * if labels_vecs != NULL: + * _free_vector(labels_vecs, 2) + */ + __pyx_t_3 = ((__pyx_v_6corels_7_corels_minor == NULL) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":289 - * labels_vecs = NULL - * if rules != NULL: - * _free_vector(rules, n_rules) # <<<<<<<<<<<<<< - * rules = NULL - * n_rules = 0 + /* "corels/_corels.pyx":303 + * minor = malloc(sizeof(rule_t)) + * if minor == NULL: + * if labels_vecs != NULL: # <<<<<<<<<<<<<< + * _free_vector(labels_vecs, 2) + * labels_vecs = NULL */ - __pyx_t_6 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_rules, __pyx_v_6corels_7_corels_n_rules); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 289, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_3 = ((__pyx_v_6corels_7_corels_labels_vecs != NULL) != 0); + if (__pyx_t_3) { - /* "corels/_corels.pyx":290 - * if rules != NULL: - * _free_vector(rules, n_rules) - * rules = NULL # <<<<<<<<<<<<<< - * n_rules = 0 - * raise MemoryError(); + /* "corels/_corels.pyx":304 + * if minor == NULL: + * if labels_vecs != NULL: + * _free_vector(labels_vecs, 2) # <<<<<<<<<<<<<< + * labels_vecs = NULL + * if rules != NULL: */ - __pyx_v_6corels_7_corels_rules = NULL; + __pyx_t_6 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_labels_vecs, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 304, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "corels/_corels.pyx":288 - * _free_vector(labels_vecs, 2) - * labels_vecs = NULL - * if rules != NULL: # <<<<<<<<<<<<<< - * _free_vector(rules, n_rules) - * rules = NULL + /* "corels/_corels.pyx":305 + * if labels_vecs != NULL: + * _free_vector(labels_vecs, 2) + * labels_vecs = NULL # <<<<<<<<<<<<<< + * if rules != NULL: + * _free_vector(rules, n_rules) */ - } + __pyx_v_6corels_7_corels_labels_vecs = NULL; - /* "corels/_corels.pyx":291 - * _free_vector(rules, n_rules) - * rules = NULL - * n_rules = 0 # <<<<<<<<<<<<<< - * raise MemoryError(); - * + /* "corels/_corels.pyx":303 + * minor = malloc(sizeof(rule_t)) + * if minor == NULL: + * if labels_vecs != NULL: # <<<<<<<<<<<<<< + * _free_vector(labels_vecs, 2) + * labels_vecs = NULL */ - __pyx_v_6corels_7_corels_n_rules = 0; + } - /* "corels/_corels.pyx":292 - * rules = NULL - * n_rules = 0 - * raise MemoryError(); # <<<<<<<<<<<<<< - * - * cdef int minor_count = 0; + /* "corels/_corels.pyx":306 + * _free_vector(labels_vecs, 2) + * labels_vecs = NULL + * if rules != NULL: # <<<<<<<<<<<<<< + * _free_vector(rules, n_rules) + * rules = NULL */ - PyErr_NoMemory(); __PYX_ERR(0, 292, __pyx_L1_error) + __pyx_t_3 = ((__pyx_v_6corels_7_corels_rules != NULL) != 0); + if (__pyx_t_3) { - /* "corels/_corels.pyx":284 - * - * minor = malloc(sizeof(rule_t)) - * if minor == NULL: # <<<<<<<<<<<<<< - * if labels_vecs != NULL: - * _free_vector(labels_vecs, 2) + /* "corels/_corels.pyx":307 + * labels_vecs = NULL + * if rules != NULL: + * _free_vector(rules, n_rules) # <<<<<<<<<<<<<< + * rules = NULL + * n_rules = 0 */ - } + __pyx_t_6 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_rules, __pyx_v_6corels_7_corels_n_rules); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 307, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "corels/_corels.pyx":294 - * raise MemoryError(); + /* "corels/_corels.pyx":308 + * if rules != NULL: + * _free_vector(rules, n_rules) + * rules = NULL # <<<<<<<<<<<<<< + * n_rules = 0 + * raise MemoryError(); + */ + __pyx_v_6corels_7_corels_rules = NULL; + + /* "corels/_corels.pyx":306 + * _free_vector(labels_vecs, 2) + * labels_vecs = NULL + * if rules != NULL: # <<<<<<<<<<<<<< + * _free_vector(rules, n_rules) + * rules = NULL + */ + } + + /* "corels/_corels.pyx":309 + * _free_vector(rules, n_rules) + * rules = NULL + * n_rules = 0 # <<<<<<<<<<<<<< + * raise MemoryError(); * - * cdef int minor_count = 0; # <<<<<<<<<<<<<< - * cdef int mr = minority(rules, n_rules, labels_vecs, nsamples, minor, minor_verbose, &minor_count) - * if mr != 0: */ - __pyx_v_minor_count = 0; + __pyx_v_6corels_7_corels_n_rules = 0; - /* "corels/_corels.pyx":295 + /* "corels/_corels.pyx":310 + * rules = NULL + * n_rules = 0 + * raise MemoryError(); # <<<<<<<<<<<<<< * - * cdef int minor_count = 0; - * cdef int mr = minority(rules, n_rules, labels_vecs, nsamples, minor, minor_verbose, &minor_count) # <<<<<<<<<<<<<< - * if mr != 0: - * if labels_vecs != NULL: + * if minority(rules, n_rules, labels_vecs, nsamples, minor, minor_verbose, &minor_count) != 0: */ - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_nsamples); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 295, __pyx_L1_error) - __pyx_v_mr = minority(__pyx_v_6corels_7_corels_rules, __pyx_v_6corels_7_corels_n_rules, __pyx_v_6corels_7_corels_labels_vecs, __pyx_t_4, __pyx_v_6corels_7_corels_minor, __pyx_v_minor_verbose, (&__pyx_v_minor_count)); + PyErr_NoMemory(); __PYX_ERR(0, 310, __pyx_L1_error) - /* "corels/_corels.pyx":296 - * cdef int minor_count = 0; - * cdef int mr = minority(rules, n_rules, labels_vecs, nsamples, minor, minor_verbose, &minor_count) - * if mr != 0: # <<<<<<<<<<<<<< - * if labels_vecs != NULL: - * _free_vector(labels_vecs, 2) + /* "corels/_corels.pyx":302 + * else: + * minor = malloc(sizeof(rule_t)) + * if minor == NULL: # <<<<<<<<<<<<<< + * if labels_vecs != NULL: + * _free_vector(labels_vecs, 2) */ - __pyx_t_3 = ((__pyx_v_mr != 0) != 0); - if (__pyx_t_3) { + } - /* "corels/_corels.pyx":297 - * cdef int mr = minority(rules, n_rules, labels_vecs, nsamples, minor, minor_verbose, &minor_count) - * if mr != 0: - * if labels_vecs != NULL: # <<<<<<<<<<<<<< - * _free_vector(labels_vecs, 2) - * labels_vecs = NULL + /* "corels/_corels.pyx":312 + * raise MemoryError(); + * + * if minority(rules, n_rules, labels_vecs, nsamples, minor, minor_verbose, &minor_count) != 0: # <<<<<<<<<<<<<< + * if labels_vecs != NULL: + * _free_vector(labels_vecs, 2) */ - __pyx_t_3 = ((__pyx_v_6corels_7_corels_labels_vecs != NULL) != 0); + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_nsamples); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_3 = ((minority(__pyx_v_6corels_7_corels_rules, __pyx_v_6corels_7_corels_n_rules, __pyx_v_6corels_7_corels_labels_vecs, __pyx_t_4, __pyx_v_6corels_7_corels_minor, __pyx_v_minor_verbose, (&__pyx_v_minor_count)) != 0) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":298 - * if mr != 0: - * if labels_vecs != NULL: - * _free_vector(labels_vecs, 2) # <<<<<<<<<<<<<< - * labels_vecs = NULL - * if rules != NULL: + /* "corels/_corels.pyx":313 + * + * if minority(rules, n_rules, labels_vecs, nsamples, minor, minor_verbose, &minor_count) != 0: + * if labels_vecs != NULL: # <<<<<<<<<<<<<< + * _free_vector(labels_vecs, 2) + * labels_vecs = NULL */ - __pyx_t_6 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_labels_vecs, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 298, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_3 = ((__pyx_v_6corels_7_corels_labels_vecs != NULL) != 0); + if (__pyx_t_3) { - /* "corels/_corels.pyx":299 - * if labels_vecs != NULL: - * _free_vector(labels_vecs, 2) - * labels_vecs = NULL # <<<<<<<<<<<<<< - * if rules != NULL: - * _free_vector(rules, n_rules) + /* "corels/_corels.pyx":314 + * if minority(rules, n_rules, labels_vecs, nsamples, minor, minor_verbose, &minor_count) != 0: + * if labels_vecs != NULL: + * _free_vector(labels_vecs, 2) # <<<<<<<<<<<<<< + * labels_vecs = NULL + * if rules != NULL: */ - __pyx_v_6corels_7_corels_labels_vecs = NULL; + __pyx_t_6 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_labels_vecs, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "corels/_corels.pyx":297 - * cdef int mr = minority(rules, n_rules, labels_vecs, nsamples, minor, minor_verbose, &minor_count) - * if mr != 0: - * if labels_vecs != NULL: # <<<<<<<<<<<<<< - * _free_vector(labels_vecs, 2) - * labels_vecs = NULL + /* "corels/_corels.pyx":315 + * if labels_vecs != NULL: + * _free_vector(labels_vecs, 2) + * labels_vecs = NULL # <<<<<<<<<<<<<< + * if rules != NULL: + * _free_vector(rules, n_rules) */ - } + __pyx_v_6corels_7_corels_labels_vecs = NULL; - /* "corels/_corels.pyx":300 - * _free_vector(labels_vecs, 2) - * labels_vecs = NULL - * if rules != NULL: # <<<<<<<<<<<<<< - * _free_vector(rules, n_rules) - * rules = NULL + /* "corels/_corels.pyx":313 + * + * if minority(rules, n_rules, labels_vecs, nsamples, minor, minor_verbose, &minor_count) != 0: + * if labels_vecs != NULL: # <<<<<<<<<<<<<< + * _free_vector(labels_vecs, 2) + * labels_vecs = NULL */ - __pyx_t_3 = ((__pyx_v_6corels_7_corels_rules != NULL) != 0); - if (__pyx_t_3) { + } - /* "corels/_corels.pyx":301 - * labels_vecs = NULL - * if rules != NULL: - * _free_vector(rules, n_rules) # <<<<<<<<<<<<<< - * rules = NULL - * n_rules = 0 + /* "corels/_corels.pyx":316 + * _free_vector(labels_vecs, 2) + * labels_vecs = NULL + * if rules != NULL: # <<<<<<<<<<<<<< + * _free_vector(rules, n_rules) + * rules = NULL */ - __pyx_t_6 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_rules, __pyx_v_6corels_7_corels_n_rules); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 301, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_3 = ((__pyx_v_6corels_7_corels_rules != NULL) != 0); + if (__pyx_t_3) { - /* "corels/_corels.pyx":302 - * if rules != NULL: - * _free_vector(rules, n_rules) - * rules = NULL # <<<<<<<<<<<<<< - * n_rules = 0 - * raise MemoryError() + /* "corels/_corels.pyx":317 + * labels_vecs = NULL + * if rules != NULL: + * _free_vector(rules, n_rules) # <<<<<<<<<<<<<< + * rules = NULL + * n_rules = 0 */ - __pyx_v_6corels_7_corels_rules = NULL; + __pyx_t_6 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_rules, __pyx_v_6corels_7_corels_n_rules); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 317, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "corels/_corels.pyx":300 - * _free_vector(labels_vecs, 2) - * labels_vecs = NULL - * if rules != NULL: # <<<<<<<<<<<<<< - * _free_vector(rules, n_rules) - * rules = NULL + /* "corels/_corels.pyx":318 + * if rules != NULL: + * _free_vector(rules, n_rules) + * rules = NULL # <<<<<<<<<<<<<< + * n_rules = 0 + * raise MemoryError() */ - } + __pyx_v_6corels_7_corels_rules = NULL; - /* "corels/_corels.pyx":303 - * _free_vector(rules, n_rules) - * rules = NULL - * n_rules = 0 # <<<<<<<<<<<<<< - * raise MemoryError() + /* "corels/_corels.pyx":316 + * _free_vector(labels_vecs, 2) + * labels_vecs = NULL + * if rules != NULL: # <<<<<<<<<<<<<< + * _free_vector(rules, n_rules) + * rules = NULL + */ + } + + /* "corels/_corels.pyx":319 + * _free_vector(rules, n_rules) + * rules = NULL + * n_rules = 0 # <<<<<<<<<<<<<< + * raise MemoryError() * """ */ - __pyx_v_6corels_7_corels_n_rules = 0; + __pyx_v_6corels_7_corels_n_rules = 0; - /* "corels/_corels.pyx":304 - * rules = NULL - * n_rules = 0 - * raise MemoryError() # <<<<<<<<<<<<<< + /* "corels/_corels.pyx":320 + * rules = NULL + * n_rules = 0 + * raise MemoryError() # <<<<<<<<<<<<<< * """ * if count_ones_vector(minor[0].truthtable, nsamples) <= 0: */ - PyErr_NoMemory(); __PYX_ERR(0, 304, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(0, 320, __pyx_L1_error) - /* "corels/_corels.pyx":296 - * cdef int minor_count = 0; - * cdef int mr = minority(rules, n_rules, labels_vecs, nsamples, minor, minor_verbose, &minor_count) - * if mr != 0: # <<<<<<<<<<<<<< - * if labels_vecs != NULL: - * _free_vector(labels_vecs, 2) + /* "corels/_corels.pyx":312 + * raise MemoryError(); + * + * if minority(rules, n_rules, labels_vecs, nsamples, minor, minor_verbose, &minor_count) != 0: # <<<<<<<<<<<<<< + * if labels_vecs != NULL: + * _free_vector(labels_vecs, 2) */ + } } + __pyx_L39:; - /* "corels/_corels.pyx":315 + /* "corels/_corels.pyx":331 * * cdef double rb = run_corels(c, verbosity, policy, map_type, ablation, calculate_size, - * n_rules, 2, nsamples, rules, labels_vecs, minor, 1000, NULL, pmap, tree, # <<<<<<<<<<<<<< - * queue, init, 10, num_threads, max_num_nodes, minor_count, 262, + * n_rules, 2, nsamples, rules, labels_vecs, minor, freq, NULL, pmap, tree, # <<<<<<<<<<<<<< + * queue, init, 10, num_threads, max_num_nodes, minor_count, random_seed, * &rulelist, &classes) */ - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_nsamples); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_nsamples); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 331, __pyx_L1_error) - /* "corels/_corels.pyx":314 + /* "corels/_corels.pyx":330 * cdef vector[int] classes * * cdef double rb = run_corels(c, verbosity, policy, map_type, ablation, calculate_size, # <<<<<<<<<<<<<< - * n_rules, 2, nsamples, rules, labels_vecs, minor, 1000, NULL, pmap, tree, - * queue, init, 10, num_threads, max_num_nodes, minor_count, 262, + * n_rules, 2, nsamples, rules, labels_vecs, minor, freq, NULL, pmap, tree, + * queue, init, 10, num_threads, max_num_nodes, minor_count, random_seed, */ - __pyx_v_rb = run_corels(__pyx_v_c, __pyx_v_verbosity, __pyx_v_policy, __pyx_v_map_type, __pyx_v_ablation, __pyx_v_calculate_size, __pyx_v_6corels_7_corels_n_rules, 2, __pyx_t_4, __pyx_v_6corels_7_corels_rules, __pyx_v_6corels_7_corels_labels_vecs, __pyx_v_6corels_7_corels_minor, 0x3E8, NULL, __pyx_v_6corels_7_corels_pmap, __pyx_v_6corels_7_corels_tree, __pyx_v_6corels_7_corels_queue, __pyx_v_6corels_7_corels_init, 10, __pyx_v_num_threads, __pyx_v_max_num_nodes, __pyx_v_minor_count, 0x106, (&__pyx_v_rulelist), (&__pyx_v_classes)); + __pyx_v_rb = run_corels(__pyx_v_c, __pyx_v_verbosity, __pyx_v_policy, __pyx_v_map_type, __pyx_v_ablation, __pyx_v_calculate_size, __pyx_v_6corels_7_corels_n_rules, 2, __pyx_t_4, __pyx_v_6corels_7_corels_rules, __pyx_v_6corels_7_corels_labels_vecs, __pyx_v_6corels_7_corels_minor, __pyx_v_freq, NULL, __pyx_v_6corels_7_corels_pmap, __pyx_v_6corels_7_corels_tree, __pyx_v_6corels_7_corels_queue, __pyx_v_6corels_7_corels_init, 10, __pyx_v_num_threads, __pyx_v_max_num_nodes, __pyx_v_minor_count, __pyx_v_random_seed, (&__pyx_v_rulelist), (&__pyx_v_classes)); - /* "corels/_corels.pyx":319 + /* "corels/_corels.pyx":335 * &rulelist, &classes) * * r_out = [] # <<<<<<<<<<<<<< * for i in range(rulelist.size()): * if rulelist[i] < n_rules: */ - __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_r_out = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; - /* "corels/_corels.pyx":320 + /* "corels/_corels.pyx":336 * * r_out = [] * for i in range(rulelist.size()): # <<<<<<<<<<<<<< @@ -5025,7 +5212,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { __pyx_v_i = __pyx_t_11; - /* "corels/_corels.pyx":321 + /* "corels/_corels.pyx":337 * r_out = [] * for i in range(rulelist.size()): * if rulelist[i] < n_rules: # <<<<<<<<<<<<<< @@ -5035,34 +5222,34 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = (((__pyx_v_rulelist[__pyx_v_i]) < __pyx_v_6corels_7_corels_n_rules) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":322 + /* "corels/_corels.pyx":338 * for i in range(rulelist.size()): * if rulelist[i] < n_rules: * r_out.append({}) # <<<<<<<<<<<<<< * r_out[i]["antecedents"] = [] * for j in range(rules[rulelist[i]].cardinality): */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_19 = __Pyx_PyList_Append(__pyx_v_r_out, __pyx_t_6); if (unlikely(__pyx_t_19 == ((int)-1))) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyList_Append(__pyx_v_r_out, __pyx_t_6); if (unlikely(__pyx_t_19 == ((int)-1))) __PYX_ERR(0, 338, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "corels/_corels.pyx":323 + /* "corels/_corels.pyx":339 * if rulelist[i] < n_rules: * r_out.append({}) * r_out[i]["antecedents"] = [] # <<<<<<<<<<<<<< * for j in range(rules[rulelist[i]].cardinality): * r_out[i]["antecedents"].append(rules[rulelist[i]].ids[j]) */ - __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_r_out, __pyx_v_i, std::vector ::size_type, 0, __Pyx_PyInt_FromSize_t, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_r_out, __pyx_v_i, std::vector ::size_type, 0, __Pyx_PyInt_FromSize_t, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_n_u_antecedents, __pyx_t_6) < 0)) __PYX_ERR(0, 323, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_n_u_antecedents, __pyx_t_6) < 0)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "corels/_corels.pyx":324 + /* "corels/_corels.pyx":340 * r_out.append({}) * r_out[i]["antecedents"] = [] * for j in range(rules[rulelist[i]].cardinality): # <<<<<<<<<<<<<< @@ -5074,45 +5261,45 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_7; __pyx_t_12+=1) { __pyx_v_j = __pyx_t_12; - /* "corels/_corels.pyx":325 + /* "corels/_corels.pyx":341 * r_out[i]["antecedents"] = [] * for j in range(rules[rulelist[i]].cardinality): * r_out[i]["antecedents"].append(rules[rulelist[i]].ids[j]) # <<<<<<<<<<<<<< * * r_out[i]["prediction"] = bool(classes[i]) */ - __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_r_out, __pyx_v_i, std::vector ::size_type, 0, __Pyx_PyInt_FromSize_t, 1, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_r_out, __pyx_v_i, std::vector ::size_type, 0, __Pyx_PyInt_FromSize_t, 1, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_t_6, __pyx_n_u_antecedents); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_t_6, __pyx_n_u_antecedents); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_6corels_7_corels_rules[(__pyx_v_rulelist[__pyx_v_i])]).ids[__pyx_v_j])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_6corels_7_corels_rules[(__pyx_v_rulelist[__pyx_v_i])]).ids[__pyx_v_j])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_19 = __Pyx_PyObject_Append(__pyx_t_5, __pyx_t_6); if (unlikely(__pyx_t_19 == ((int)-1))) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_Append(__pyx_t_5, __pyx_t_6); if (unlikely(__pyx_t_19 == ((int)-1))) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - /* "corels/_corels.pyx":327 + /* "corels/_corels.pyx":343 * r_out[i]["antecedents"].append(rules[rulelist[i]].ids[j]) * * r_out[i]["prediction"] = bool(classes[i]) # <<<<<<<<<<<<<< * * r_out.append({ "antecedents": [0], "prediction": bool(classes[rulelist.size()]) }) */ - __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_classes[__pyx_v_i])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 327, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_classes[__pyx_v_i])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 327, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyBool_FromLong((!(!__pyx_t_3))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 327, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyBool_FromLong((!(!__pyx_t_3))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_r_out, __pyx_v_i, std::vector ::size_type, 0, __Pyx_PyInt_FromSize_t, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 327, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_r_out, __pyx_v_i, std::vector ::size_type, 0, __Pyx_PyInt_FromSize_t, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_n_u_prediction, __pyx_t_6) < 0)) __PYX_ERR(0, 327, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_n_u_prediction, __pyx_t_6) < 0)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "corels/_corels.pyx":321 + /* "corels/_corels.pyx":337 * r_out = [] * for i in range(rulelist.size()): * if rulelist[i] < n_rules: # <<<<<<<<<<<<<< @@ -5122,34 +5309,34 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec } } - /* "corels/_corels.pyx":329 + /* "corels/_corels.pyx":345 * r_out[i]["prediction"] = bool(classes[i]) * * r_out.append({ "antecedents": [0], "prediction": bool(classes[rulelist.size()]) }) # <<<<<<<<<<<<<< * * if rb == -1: */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyList_SET_ITEM(__pyx_t_5, 0, __pyx_int_0); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_antecedents, __pyx_t_5) < 0) __PYX_ERR(0, 329, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_antecedents, __pyx_t_5) < 0) __PYX_ERR(0, 345, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyInt_From_int((__pyx_v_classes[__pyx_v_rulelist.size()])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int((__pyx_v_classes[__pyx_v_rulelist.size()])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 345, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyBool_FromLong((!(!__pyx_t_3))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyBool_FromLong((!(!__pyx_t_3))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_prediction, __pyx_t_5) < 0) __PYX_ERR(0, 329, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_prediction, __pyx_t_5) < 0) __PYX_ERR(0, 345, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_19 = __Pyx_PyList_Append(__pyx_v_r_out, __pyx_t_6); if (unlikely(__pyx_t_19 == ((int)-1))) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyList_Append(__pyx_v_r_out, __pyx_t_6); if (unlikely(__pyx_t_19 == ((int)-1))) __PYX_ERR(0, 345, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "corels/_corels.pyx":331 + /* "corels/_corels.pyx":347 * r_out.append({ "antecedents": [0], "prediction": bool(classes[rulelist.size()]) }) * * if rb == -1: # <<<<<<<<<<<<<< @@ -5159,7 +5346,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = ((__pyx_v_rb == -1.0) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":332 + /* "corels/_corels.pyx":348 * * if rb == -1: * if labels_vecs != NULL: # <<<<<<<<<<<<<< @@ -5169,18 +5356,18 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = ((__pyx_v_6corels_7_corels_labels_vecs != NULL) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":333 + /* "corels/_corels.pyx":349 * if rb == -1: * if labels_vecs != NULL: * _free_vector(labels_vecs, 2) # <<<<<<<<<<<<<< * labels_vecs = NULL * if minor != NULL: */ - __pyx_t_6 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_labels_vecs, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_6 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_labels_vecs, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "corels/_corels.pyx":334 + /* "corels/_corels.pyx":350 * if labels_vecs != NULL: * _free_vector(labels_vecs, 2) * labels_vecs = NULL # <<<<<<<<<<<<<< @@ -5189,7 +5376,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_6corels_7_corels_labels_vecs = NULL; - /* "corels/_corels.pyx":332 + /* "corels/_corels.pyx":348 * * if rb == -1: * if labels_vecs != NULL: # <<<<<<<<<<<<<< @@ -5198,7 +5385,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":335 + /* "corels/_corels.pyx":351 * _free_vector(labels_vecs, 2) * labels_vecs = NULL * if minor != NULL: # <<<<<<<<<<<<<< @@ -5208,18 +5395,18 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = ((__pyx_v_6corels_7_corels_minor != NULL) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":336 + /* "corels/_corels.pyx":352 * labels_vecs = NULL * if minor != NULL: * _free_vector(minor, 1) # <<<<<<<<<<<<<< * minor = NULL * if rules != NULL: */ - __pyx_t_6 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_minor, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_6 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_minor, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "corels/_corels.pyx":337 + /* "corels/_corels.pyx":353 * if minor != NULL: * _free_vector(minor, 1) * minor = NULL # <<<<<<<<<<<<<< @@ -5228,7 +5415,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_6corels_7_corels_minor = NULL; - /* "corels/_corels.pyx":335 + /* "corels/_corels.pyx":351 * _free_vector(labels_vecs, 2) * labels_vecs = NULL * if minor != NULL: # <<<<<<<<<<<<<< @@ -5237,7 +5424,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":338 + /* "corels/_corels.pyx":354 * _free_vector(minor, 1) * minor = NULL * if rules != NULL: # <<<<<<<<<<<<<< @@ -5247,18 +5434,18 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_t_3 = ((__pyx_v_6corels_7_corels_rules != NULL) != 0); if (__pyx_t_3) { - /* "corels/_corels.pyx":339 + /* "corels/_corels.pyx":355 * minor = NULL * if rules != NULL: * _free_vector(rules, n_rules) # <<<<<<<<<<<<<< * rules = NULL * n_rules = 0 */ - __pyx_t_6 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_rules, __pyx_v_6corels_7_corels_n_rules); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 339, __pyx_L1_error) + __pyx_t_6 = __pyx_f_6corels_7_corels__free_vector(__pyx_v_6corels_7_corels_rules, __pyx_v_6corels_7_corels_n_rules); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "corels/_corels.pyx":340 + /* "corels/_corels.pyx":356 * if rules != NULL: * _free_vector(rules, n_rules) * rules = NULL # <<<<<<<<<<<<<< @@ -5267,7 +5454,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_6corels_7_corels_rules = NULL; - /* "corels/_corels.pyx":338 + /* "corels/_corels.pyx":354 * _free_vector(minor, 1) * minor = NULL * if rules != NULL: # <<<<<<<<<<<<<< @@ -5276,7 +5463,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":341 + /* "corels/_corels.pyx":357 * _free_vector(rules, n_rules) * rules = NULL * n_rules = 0 # <<<<<<<<<<<<<< @@ -5285,7 +5472,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ __pyx_v_6corels_7_corels_n_rules = 0; - /* "corels/_corels.pyx":343 + /* "corels/_corels.pyx":359 * n_rules = 0 * * return Exception # <<<<<<<<<<<<<< @@ -5297,7 +5484,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_r = ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])); goto __pyx_L0; - /* "corels/_corels.pyx":331 + /* "corels/_corels.pyx":347 * r_out.append({ "antecedents": [0], "prediction": bool(classes[rulelist.size()]) }) * * if rb == -1: # <<<<<<<<<<<<<< @@ -5306,7 +5493,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec */ } - /* "corels/_corels.pyx":345 + /* "corels/_corels.pyx":361 * return Exception * * return r_out # <<<<<<<<<<<<<< @@ -5318,7 +5505,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __pyx_r = __pyx_v_r_out; goto __pyx_L0; - /* "corels/_corels.pyx":171 + /* "corels/_corels.pyx":177 * cdef set[string] run_verbosity * * def fit_wrap_begin(np.ndarray[np.uint8_t, ndim=2] samples, # <<<<<<<<<<<<<< @@ -5336,6 +5523,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec __Pyx_PyThreadState_assign __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minority_list.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_samples.rcbuffer->pybuffer); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} __Pyx_AddTraceback("corels._corels.fit_wrap_begin", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -5343,6 +5531,7 @@ static PyObject *__pyx_pf_6corels_7_corels_2fit_wrap_begin(CYTHON_UNUSED PyObjec goto __pyx_L2; __pyx_L0:; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_labels.rcbuffer->pybuffer); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_minority_list.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_samples.rcbuffer->pybuffer); __pyx_L2:; __Pyx_XDECREF(__pyx_v_nsamples); @@ -7885,6 +8074,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_features, __pyx_k_features, sizeof(__pyx_k_features), 0, 0, 1, 1}, {&__pyx_n_s_features_vec, __pyx_k_features_vec, sizeof(__pyx_k_features_vec), 0, 0, 1, 1}, {&__pyx_n_s_fit_wrap_begin, __pyx_k_fit_wrap_begin, sizeof(__pyx_k_fit_wrap_begin), 0, 0, 1, 1}, + {&__pyx_n_s_freq, __pyx_k_freq, sizeof(__pyx_k_freq), 0, 0, 1, 1}, {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, {&__pyx_n_s_idx, __pyx_k_idx, sizeof(__pyx_k_idx), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, @@ -7898,7 +8088,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_mine_verbose, __pyx_k_mine_verbose, sizeof(__pyx_k_mine_verbose), 0, 0, 1, 1}, {&__pyx_n_s_minor_count, __pyx_k_minor_count, sizeof(__pyx_k_minor_count), 0, 0, 1, 1}, {&__pyx_n_s_minor_verbose, __pyx_k_minor_verbose, sizeof(__pyx_k_minor_verbose), 0, 0, 1, 1}, - {&__pyx_n_s_mr, __pyx_k_mr, sizeof(__pyx_k_mr), 0, 0, 1, 1}, + {&__pyx_n_s_minority_list, __pyx_k_minority_list, sizeof(__pyx_k_minority_list), 0, 0, 1, 1}, {&__pyx_n_s_n_rules, __pyx_k_n_rules, sizeof(__pyx_k_n_rules), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, @@ -7921,6 +8111,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_predictions, __pyx_k_predictions, sizeof(__pyx_k_predictions), 0, 0, 1, 1}, {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1}, {&__pyx_n_s_r_out, __pyx_k_r_out, sizeof(__pyx_k_r_out), 0, 0, 1, 1}, + {&__pyx_n_s_random_seed, __pyx_k_random_seed, sizeof(__pyx_k_random_seed), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, {&__pyx_n_s_rb, __pyx_k_rb, sizeof(__pyx_k_rb), 0, 0, 1, 1}, {&__pyx_n_s_rulelist, __pyx_k_rulelist, sizeof(__pyx_k_rulelist), 0, 0, 1, 1}, @@ -7938,9 +8129,9 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, 0, 0, 0, 0, 0, 0} }; static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 76, __pyx_L1_error) - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 120, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 77, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 121, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 140, __pyx_L1_error) __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 855, __pyx_L1_error) __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 1037, __pyx_L1_error) return 0; @@ -7952,14 +8143,14 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "corels/_corels.pyx":139 + /* "corels/_corels.pyx":140 * * free(vectors) * raise ValueError("Could not load samples") # <<<<<<<<<<<<<< * * ncount_out[0] = ncount */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_Could_not_load_samples); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_Could_not_load_samples); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); @@ -8040,29 +8231,29 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); - /* "corels/_corels.pyx":60 + /* "corels/_corels.pyx":61 * @cython.boundscheck(False) * @cython.wraparound(False) * def predict_wrap(np.ndarray[np.uint8_t, ndim=2] X, rules): # <<<<<<<<<<<<<< * cdef int nsamples = X.shape[0] * cdef int nfeatures = X.shape[1] */ - __pyx_tuple__11 = PyTuple_Pack(17, __pyx_n_s_X, __pyx_n_s_rules, __pyx_n_s_nsamples, __pyx_n_s_nfeatures, __pyx_n_s_out, __pyx_n_s_n_rules, __pyx_n_s_s, __pyx_n_s_r, __pyx_n_s_next_rule, __pyx_n_s_nidx, __pyx_n_s_a, __pyx_n_s_idx, __pyx_n_s_c, __pyx_n_s_default, __pyx_n_s_antecedent_lengths, __pyx_n_s_predictions, __pyx_n_s_antecedents); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 60, __pyx_L1_error) + __pyx_tuple__11 = PyTuple_Pack(17, __pyx_n_s_X, __pyx_n_s_rules, __pyx_n_s_nsamples, __pyx_n_s_nfeatures, __pyx_n_s_out, __pyx_n_s_n_rules, __pyx_n_s_s, __pyx_n_s_r, __pyx_n_s_next_rule, __pyx_n_s_nidx, __pyx_n_s_a, __pyx_n_s_idx, __pyx_n_s_c, __pyx_n_s_default, __pyx_n_s_antecedent_lengths, __pyx_n_s_predictions, __pyx_n_s_antecedents); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); - __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 17, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_corels_pyx, __pyx_n_s_predict_wrap, 60, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 60, __pyx_L1_error) + __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 17, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_corels_pyx, __pyx_n_s_predict_wrap, 61, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 61, __pyx_L1_error) - /* "corels/_corels.pyx":171 + /* "corels/_corels.pyx":177 * cdef set[string] run_verbosity * * def fit_wrap_begin(np.ndarray[np.uint8_t, ndim=2] samples, # <<<<<<<<<<<<<< * np.ndarray[np.uint8_t, ndim=2] labels, * features, int max_card, double min_support, verbosity_str, int mine_verbose, */ - __pyx_tuple__13 = PyTuple_Pack(33, __pyx_n_s_samples, __pyx_n_s_labels, __pyx_n_s_features, __pyx_n_s_max_card, __pyx_n_s_min_support, __pyx_n_s_verbosity_str, __pyx_n_s_mine_verbose, __pyx_n_s_minor_verbose, __pyx_n_s_c, __pyx_n_s_policy, __pyx_n_s_map_type, __pyx_n_s_ablation, __pyx_n_s_calculate_size, __pyx_n_s_pre_mine, __pyx_n_s_num_threads, __pyx_n_s_max_num_nodes, __pyx_n_s_nfeatures, __pyx_n_s_samples_vecs, __pyx_n_s_nsamples, __pyx_n_s_features_vec, __pyx_n_s_i, __pyx_n_s_bytestr, __pyx_n_s_j, __pyx_n_s_r, __pyx_n_s_verbosity_ascii, __pyx_n_s_verbosity, __pyx_n_s_nsamples_chk, __pyx_n_s_minor_count, __pyx_n_s_mr, __pyx_n_s_rulelist, __pyx_n_s_classes, __pyx_n_s_rb, __pyx_n_s_r_out); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 171, __pyx_L1_error) + __pyx_tuple__13 = PyTuple_Pack(35, __pyx_n_s_samples, __pyx_n_s_labels, __pyx_n_s_features, __pyx_n_s_max_card, __pyx_n_s_min_support, __pyx_n_s_verbosity_str, __pyx_n_s_mine_verbose, __pyx_n_s_minor_verbose, __pyx_n_s_c, __pyx_n_s_policy, __pyx_n_s_map_type, __pyx_n_s_ablation, __pyx_n_s_calculate_size, __pyx_n_s_pre_mine, __pyx_n_s_num_threads, __pyx_n_s_max_num_nodes, __pyx_n_s_minority_list, __pyx_n_s_random_seed, __pyx_n_s_freq, __pyx_n_s_nfeatures, __pyx_n_s_samples_vecs, __pyx_n_s_nsamples, __pyx_n_s_features_vec, __pyx_n_s_i, __pyx_n_s_bytestr, __pyx_n_s_j, __pyx_n_s_r, __pyx_n_s_verbosity_ascii, __pyx_n_s_verbosity, __pyx_n_s_nsamples_chk, __pyx_n_s_minor_count, __pyx_n_s_rulelist, __pyx_n_s_classes, __pyx_n_s_rb, __pyx_n_s_r_out); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); - __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(16, 0, 33, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_corels_pyx, __pyx_n_s_fit_wrap_begin, 171, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 171, __pyx_L1_error) + __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(19, 0, 35, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_corels_pyx, __pyx_n_s_fit_wrap_begin, 177, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -8376,31 +8567,31 @@ if (!__Pyx_RefNanny) { if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif - /* "corels/_corels.pyx":9 - * from libcpp.set cimport set + /* "corels/_corels.pyx":10 * from libcpp.string cimport string + * from libc.stdio cimport printf * import numpy as np # <<<<<<<<<<<<<< * cimport numpy as np * cimport cython */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "corels/_corels.pyx":60 + /* "corels/_corels.pyx":61 * @cython.boundscheck(False) * @cython.wraparound(False) * def predict_wrap(np.ndarray[np.uint8_t, ndim=2] X, rules): # <<<<<<<<<<<<<< * cdef int nsamples = X.shape[0] * cdef int nfeatures = X.shape[1] */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6corels_7_corels_1predict_wrap, NULL, __pyx_n_s_corels__corels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6corels_7_corels_1predict_wrap, NULL, __pyx_n_s_corels__corels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_predict_wrap, __pyx_t_1) < 0) __PYX_ERR(0, 60, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_predict_wrap, __pyx_t_1) < 0) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "corels/_corels.pyx":161 + /* "corels/_corels.pyx":167 * free(vs) * * cdef rule_t* rules = NULL # <<<<<<<<<<<<<< @@ -8409,7 +8600,7 @@ if (!__Pyx_RefNanny) { */ __pyx_v_6corels_7_corels_rules = NULL; - /* "corels/_corels.pyx":162 + /* "corels/_corels.pyx":168 * * cdef rule_t* rules = NULL * cdef rule_t* labels_vecs = NULL # <<<<<<<<<<<<<< @@ -8418,7 +8609,7 @@ if (!__Pyx_RefNanny) { */ __pyx_v_6corels_7_corels_labels_vecs = NULL; - /* "corels/_corels.pyx":163 + /* "corels/_corels.pyx":169 * cdef rule_t* rules = NULL * cdef rule_t* labels_vecs = NULL * cdef rule_t* minor = NULL # <<<<<<<<<<<<<< @@ -8427,7 +8618,7 @@ if (!__Pyx_RefNanny) { */ __pyx_v_6corels_7_corels_minor = NULL; - /* "corels/_corels.pyx":164 + /* "corels/_corels.pyx":170 * cdef rule_t* labels_vecs = NULL * cdef rule_t* minor = NULL * cdef int n_rules = 0 # <<<<<<<<<<<<<< @@ -8436,7 +8627,7 @@ if (!__Pyx_RefNanny) { */ __pyx_v_6corels_7_corels_n_rules = 0; - /* "corels/_corels.pyx":165 + /* "corels/_corels.pyx":171 * cdef rule_t* minor = NULL * cdef int n_rules = 0 * cdef PermutationMap* pmap = NULL # <<<<<<<<<<<<<< @@ -8445,7 +8636,7 @@ if (!__Pyx_RefNanny) { */ __pyx_v_6corels_7_corels_pmap = NULL; - /* "corels/_corels.pyx":166 + /* "corels/_corels.pyx":172 * cdef int n_rules = 0 * cdef PermutationMap* pmap = NULL * cdef CacheTree* tree = NULL # <<<<<<<<<<<<<< @@ -8454,7 +8645,7 @@ if (!__Pyx_RefNanny) { */ __pyx_v_6corels_7_corels_tree = NULL; - /* "corels/_corels.pyx":167 + /* "corels/_corels.pyx":173 * cdef PermutationMap* pmap = NULL * cdef CacheTree* tree = NULL * cdef Queue* queue = NULL # <<<<<<<<<<<<<< @@ -8463,7 +8654,7 @@ if (!__Pyx_RefNanny) { */ __pyx_v_6corels_7_corels_queue = NULL; - /* "corels/_corels.pyx":168 + /* "corels/_corels.pyx":174 * cdef CacheTree* tree = NULL * cdef Queue* queue = NULL * cdef double init = 0.0 # <<<<<<<<<<<<<< @@ -8472,16 +8663,16 @@ if (!__Pyx_RefNanny) { */ __pyx_v_6corels_7_corels_init = 0.0; - /* "corels/_corels.pyx":171 + /* "corels/_corels.pyx":177 * cdef set[string] run_verbosity * * def fit_wrap_begin(np.ndarray[np.uint8_t, ndim=2] samples, # <<<<<<<<<<<<<< * np.ndarray[np.uint8_t, ndim=2] labels, * features, int max_card, double min_support, verbosity_str, int mine_verbose, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6corels_7_corels_3fit_wrap_begin, NULL, __pyx_n_s_corels__corels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6corels_7_corels_3fit_wrap_begin, NULL, __pyx_n_s_corels__corels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_fit_wrap_begin, __pyx_t_1) < 0) __PYX_ERR(0, 171, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_fit_wrap_begin, __pyx_t_1) < 0) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "corels/_corels.pyx":1 @@ -10773,6 +10964,37 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { } } +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + /* Declarations */ #if CYTHON_CCOMPLEX #ifdef __cplusplus @@ -11490,37 +11712,6 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { return (size_t) -1; } -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { - const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(long) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(long) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(long) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(long), - little, !is_unsigned); - } -} - /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; diff --git a/corels/_corels.pyx b/corels/_corels.pyx index 47cc09a..7eba4f5 100644 --- a/corels/_corels.pyx +++ b/corels/_corels.pyx @@ -6,6 +6,7 @@ from libc.stdlib cimport malloc, free from libcpp.vector cimport vector from libcpp.set cimport set from libcpp.string cimport string +from libc.stdio cimport printf import numpy as np cimport numpy as np cimport cython @@ -149,13 +150,18 @@ cdef rule_t* _to_vector(np.ndarray[np.uint8_t, ndim=2] X, int* ncount_out): cdef _free_vector(rule_t* vs, int count): if vs == NULL: return - + + printf("before for loop\n") for i in range(count): + printf("before rule_vfree\n") rule_vfree(&vs[i].truthtable) + printf("before vs[i].features\n") if vs[i].features: + printf("before free") free(vs[i].features) - + + printf("after for loop\n") free(vs) cdef rule_t* rules = NULL @@ -172,12 +178,16 @@ def fit_wrap_begin(np.ndarray[np.uint8_t, ndim=2] samples, np.ndarray[np.uint8_t, ndim=2] labels, features, int max_card, double min_support, verbosity_str, int mine_verbose, int minor_verbose, double c, int policy, int map_type, int ablation, - int calculate_size, int pre_mine, int num_threads, int max_num_nodes): + int calculate_size, int pre_mine, int num_threads, int max_num_nodes, + np.ndarray[np.uint8_t, ndim=2] minority_list, int random_seed, int freq): global rules global labels_vecs global minor global n_rules + rules = NULL + labels_vecs = NULL + minor = NULL cdef int nfeatures = 0 cdef rule_t* samples_vecs = _to_vector(samples, &nfeatures) @@ -224,7 +234,7 @@ def fit_wrap_begin(np.ndarray[np.uint8_t, ndim=2] samples, free(features_vec[i]) free(features_vec) features_vec = NULL - + if samples_vecs != NULL: _free_vector(samples_vecs, nsamples) samples_vecs = NULL @@ -275,33 +285,39 @@ def fit_wrap_begin(np.ndarray[np.uint8_t, ndim=2] samples, raise MemoryError(); strcpy(labels_vecs[0].features, "label=0") strcpy(labels_vecs[1].features, "label=1") - + if minor != NULL: _free_vector(minor, 1) minor = NULL - minor = malloc(sizeof(rule_t)) - if minor == NULL: - if labels_vecs != NULL: - _free_vector(labels_vecs, 2) - labels_vecs = NULL - if rules != NULL: - _free_vector(rules, n_rules) - rules = NULL - n_rules = 0 - raise MemoryError(); - cdef int minor_count = 0; - cdef int mr = minority(rules, n_rules, labels_vecs, nsamples, minor, minor_verbose, &minor_count) - if mr != 0: - if labels_vecs != NULL: - _free_vector(labels_vecs, 2) - labels_vecs = NULL - if rules != NULL: - _free_vector(rules, n_rules) - rules = NULL - n_rules = 0 - raise MemoryError() + if minority_list[0][0] < 0: + printf("in _to_vector\n") + minor = _to_vector(minority_list, &minor_count) + minor.features = malloc(9) + strcpy(minor.features, "minority") + printf("minor count is %i\n", minor_count) + else: + minor = malloc(sizeof(rule_t)) + if minor == NULL: + if labels_vecs != NULL: + _free_vector(labels_vecs, 2) + labels_vecs = NULL + if rules != NULL: + _free_vector(rules, n_rules) + rules = NULL + n_rules = 0 + raise MemoryError(); + + if minority(rules, n_rules, labels_vecs, nsamples, minor, minor_verbose, &minor_count) != 0: + if labels_vecs != NULL: + _free_vector(labels_vecs, 2) + labels_vecs = NULL + if rules != NULL: + _free_vector(rules, n_rules) + rules = NULL + n_rules = 0 + raise MemoryError() """ if count_ones_vector(minor[0].truthtable, nsamples) <= 0: if minor != NULL: @@ -312,8 +328,8 @@ def fit_wrap_begin(np.ndarray[np.uint8_t, ndim=2] samples, cdef vector[int] classes cdef double rb = run_corels(c, verbosity, policy, map_type, ablation, calculate_size, - n_rules, 2, nsamples, rules, labels_vecs, minor, 1000, NULL, pmap, tree, - queue, init, 10, num_threads, max_num_nodes, minor_count, 262, + n_rules, 2, nsamples, rules, labels_vecs, minor, freq, NULL, pmap, tree, + queue, init, 10, num_threads, max_num_nodes, minor_count, random_seed, &rulelist, &classes) r_out = [] diff --git a/corels/corels.py b/corels/corels.py index e5ba027..bc7dfac 100644 --- a/corels/corels.py +++ b/corels/corels.py @@ -92,7 +92,8 @@ class CorelsClassifier: _estimator_type = "classifier" def __init__(self, c=0.01, n_iter=10000, map_type="prefix", policy="lower_bound", - verbosity=["rulelist"], ablation=0, max_card=2, min_support=0.01, pre_mine=1, random_seed=262, num_threads=1): + verbosity=["rulelist"], ablation=0, max_card=2, min_support=0.01, pre_mine=1, random_seed=262, + num_threads=1, logging_freq=10): self.c = c self.n_iter = n_iter self.map_type = map_type @@ -104,8 +105,9 @@ def __init__(self, c=0.01, n_iter=10000, map_type="prefix", policy="lower_bound" self.pre_mine = pre_mine self.random_seed = random_seed self.num_threads = num_threads + self.logging_freq = logging_freq - def fit(self, X, y, features=[], prediction_name="prediction"): + def fit(self, X, y, features=[], prediction_name="prediction", minor=None): """ Build a CORELS classifier from the training set (X, y). @@ -161,13 +163,21 @@ def fit(self, X, y, features=[], prediction_name="prediction"): if not isinstance(self.pre_mine, int): raise TypeError("Pre_mine must be an int, got: " + str(type(self.pre_mine))) if not isinstance(self.random_seed, int): - raise TypeError("Pre_mine must be an int, got: " + str(type(self.random_seed))) + raise TypeError("Random seed must be an int, got: " + str(type(self.random_seed))) + if not isinstance(self.num_threads, int): + raise TypeError("Number of threads must be an int, got: " + str(type(self.num_threads))) label = check_array(y, ndim=1) labels = np.stack([ np.invert(label), label ]) samples = check_array(X, ndim=2) check_consistent_length(samples, labels) + minorities = np.empty([1, 1]) + minorities[0][0] = -1 + if minor is not None: + minority = check_array(minor, ndim=1) + minorities = np.stack([ np.invert(minority), minority ]) + n_samples = samples.shape[0] n_features = samples.shape[1] if self.max_card > n_features: @@ -240,7 +250,8 @@ def fit(self, X, y, features=[], prediction_name="prediction"): rl.rules = fit_wrap_begin(samples.astype(np.uint8, copy=False), labels.astype(np.uint8, copy=False), rl.features, self.max_card, self.min_support, verbose, mine_verbose, minor_verbose, - self.c, policy_id, map_id, self.ablation, False, self.pre_mine, self.num_threads, self.n_iter) + self.c, policy_id, map_id, self.ablation, False, self.pre_mine, self.num_threads, + self.n_iter, minorities.astype(np.uint8, copy=False), self.random_seed, self.logging_freq) self.rl_ = rl diff --git a/corels/src/corels b/corels/src/corels index a19504c..ddb34ca 160000 --- a/corels/src/corels +++ b/corels/src/corels @@ -1 +1 @@ -Subproject commit a19504c9e68b217307d252ffc0cc4c378b593b2e +Subproject commit ddb34ca2a4102ad3cb3541a2f56256d0611c6905