diff --git a/fa2/fa2util.c b/fa2/fa2util.c index 4797b03..406d8f8 100644 --- a/fa2/fa2util.c +++ b/fa2/fa2util.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.29.12 */ +/* Generated by Cython 0.29.15 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -7,9 +7,9 @@ #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_12" -#define CYTHON_HEX_VERSION 0x001D0CF0 -#define CYTHON_FUTURE_DIVISION 1 +#define CYTHON_ABI "0_29_15" +#define CYTHON_HEX_VERSION 0x001D0FF0 +#define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -801,9 +801,9 @@ static const char *__pyx_filename; static const char *__pyx_f[] = { - "fa2/fa2util.py", - "fa2/fa2util.pxd", + "fa2util.pxd", "stringsource", + "fa2util.py", }; /*--- Type declarations ---*/ @@ -878,7 +878,7 @@ struct __pyx_opt_args_3fa2_7fa2util_apply_gravity { int useStrongGravity; }; -/* "fa2/fa2util.pxd":102 +/* "fa2/fa2util.pxd":100 * @cython.locals(distance = cython.double, * subregion = Region) * cdef void applyForce(self, Node n, double theta, double coefficient=*) # <<<<<<<<<<<<<< @@ -890,7 +890,7 @@ struct __pyx_opt_args_3fa2_7fa2util_6Region_applyForce { double coefficient; }; -/* "fa2/fa2util.pxd":105 +/* "fa2/fa2util.pxd":103 * * @cython.locals(n = Node) * cpdef applyForceOnNodes(self, list nodes, double theta, double coefficient=*) # <<<<<<<<<<<<<< @@ -1036,16 +1036,6 @@ static struct __pyx_vtabstruct_3fa2_7fa2util_Region *__pyx_vtabptr_3fa2_7fa2util #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) -/* PyObjectGetAttrStr.proto */ -#if CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); -#else -#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) -#endif - -/* GetBuiltinName.proto */ -static PyObject *__Pyx_GetBuiltinName(PyObject *name); - /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); @@ -1097,12 +1087,22 @@ static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + /* GetAttr.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /* GetAttr3.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) @@ -1432,12 +1432,22 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); +/* Print.proto */ +static int __Pyx_Print(PyObject*, PyObject *, int); +#if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3 +static PyObject* __pyx_print = 0; +static PyObject* __pyx_print_kwargs = 0; +#endif + /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); +/* PrintOne.proto */ +static int __Pyx_PrintOne(PyObject* stream, PyObject *o); + /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); @@ -1491,15 +1501,16 @@ extern int __pyx_module_is_main_fa2__fa2util; int __pyx_module_is_main_fa2__fa2util = 0; /* Implementation of 'fa2.fa2util' */ -static PyObject *__pyx_builtin_print; static const char __pyx_k_e[] = "e"; static const char __pyx_k_n1[] = "n1"; static const char __pyx_k_n2[] = "n2"; +static const char __pyx_k_end[] = "end"; static const char __pyx_k_inf[] = "inf"; static const char __pyx_k_new[] = "__new__"; static const char __pyx_k_Edge[] = "Edge"; static const char __pyx_k_Node[] = "Node"; static const char __pyx_k_dict[] = "__dict__"; +static const char __pyx_k_file[] = "file"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_math[] = "math"; static const char __pyx_k_name[] = "__name__"; @@ -1524,6 +1535,7 @@ static const char __pyx_k_pyx_type[] = "__pyx_type"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; +static const char __pyx_k_fa2util_py[] = "fa2util.py"; static const char __pyx_k_pyx_result[] = "__pyx_result"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_PickleError[] = "PickleError"; @@ -1536,7 +1548,6 @@ static const char __pyx_k_use_setstate[] = "use_setstate"; static const char __pyx_k_apply_gravity[] = "apply_gravity"; static const char __pyx_k_linAttraction[] = "linAttraction"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; -static const char __pyx_k_fa2_fa2util_py[] = "fa2/fa2util.py"; static const char __pyx_k_apply_repulsion[] = "apply_repulsion"; static const char __pyx_k_buildSubRegions[] = "buildSubRegions"; static const char __pyx_k_jitterTolerance[] = "jitterTolerance"; @@ -1572,7 +1583,7 @@ static PyObject *__pyx_n_s_Edge___setstate_cython; static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x2f; static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x66; static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb4; -static PyObject *__pyx_kp_u_No_cython_detected_Install_cytho; +static PyObject *__pyx_kp_s_No_cython_detected_Install_cytho; static PyObject *__pyx_n_s_Node; static PyObject *__pyx_n_s_Node___reduce_cython; static PyObject *__pyx_n_s_Node___setstate_cython; @@ -1582,7 +1593,7 @@ static PyObject *__pyx_n_s_Region___reduce_cython; static PyObject *__pyx_n_s_Region___setstate_cython; static PyObject *__pyx_n_s_Region_applyForceOnNodes; static PyObject *__pyx_n_s_Region_buildSubRegions; -static PyObject *__pyx_kp_u_Warning_uncompiled_fa2util_modul; +static PyObject *__pyx_kp_s_Warning_uncompiled_fa2util_modul; static PyObject *__pyx_n_s_adjustSpeedAndApplyForces; static PyObject *__pyx_n_s_applyForceOnNodes; static PyObject *__pyx_n_s_apply_attraction; @@ -1597,12 +1608,14 @@ static PyObject *__pyx_n_s_distributedAttraction; static PyObject *__pyx_n_s_e; static PyObject *__pyx_n_s_edgeWeightInfluence; static PyObject *__pyx_n_s_edges; +static PyObject *__pyx_n_s_end; static PyObject *__pyx_n_s_fa2_fa2util; -static PyObject *__pyx_kp_s_fa2_fa2util_py; +static PyObject *__pyx_kp_s_fa2util_py; +static PyObject *__pyx_n_s_file; static PyObject *__pyx_n_s_getstate; static PyObject *__pyx_n_s_gravity; static PyObject *__pyx_n_s_import; -static PyObject *__pyx_n_u_inf; +static PyObject *__pyx_n_s_inf; static PyObject *__pyx_n_s_jitterTolerance; static PyObject *__pyx_n_s_linAttraction; static PyObject *__pyx_n_s_main; @@ -1631,9 +1644,7 @@ static PyObject *__pyx_n_s_self; static PyObject *__pyx_n_s_setstate; static PyObject *__pyx_n_s_setstate_cython; static PyObject *__pyx_n_s_speed; -static PyObject *__pyx_n_u_speed; static PyObject *__pyx_n_s_speedEfficiency; -static PyObject *__pyx_n_u_speedEfficiency; static PyObject *__pyx_n_s_sqrt; static PyObject *__pyx_n_s_state; static PyObject *__pyx_kp_s_stringsource; @@ -1717,10 +1728,8 @@ static PyObject *__pyx_tuple__21; static PyObject *__pyx_tuple__23; static PyObject *__pyx_tuple__25; static PyObject *__pyx_tuple__27; -static PyObject *__pyx_tuple__28; static PyObject *__pyx_tuple__29; static PyObject *__pyx_tuple__31; -static PyObject *__pyx_tuple__33; static PyObject *__pyx_codeobj__2; static PyObject *__pyx_codeobj__4; static PyObject *__pyx_codeobj__6; @@ -1734,9 +1743,9 @@ static PyObject *__pyx_codeobj__20; static PyObject *__pyx_codeobj__22; static PyObject *__pyx_codeobj__24; static PyObject *__pyx_codeobj__26; +static PyObject *__pyx_codeobj__28; static PyObject *__pyx_codeobj__30; static PyObject *__pyx_codeobj__32; -static PyObject *__pyx_codeobj__34; /* Late includes */ /* "fa2/fa2util.py":18 @@ -1872,7 +1881,7 @@ static PyObject *__pyx_pf_3fa2_7fa2util_4Node_4mass___get__(struct __pyx_obj_3fa PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->mass); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 19, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->mass); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -1907,7 +1916,7 @@ static int __pyx_pf_3fa2_7fa2util_4Node_4mass_2__set__(struct __pyx_obj_3fa2_7fa __Pyx_RefNannyDeclarations double __pyx_t_1; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 19, __pyx_L1_error) + __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L1_error) __pyx_v_self->mass = __pyx_t_1; /* function exit code */ @@ -1948,7 +1957,7 @@ static PyObject *__pyx_pf_3fa2_7fa2util_4Node_6old_dx___get__(struct __pyx_obj_3 PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->old_dx); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 20, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->old_dx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -1983,7 +1992,7 @@ static int __pyx_pf_3fa2_7fa2util_4Node_6old_dx_2__set__(struct __pyx_obj_3fa2_7 __Pyx_RefNannyDeclarations double __pyx_t_1; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 20, __pyx_L1_error) + __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 20, __pyx_L1_error) __pyx_v_self->old_dx = __pyx_t_1; /* function exit code */ @@ -2016,7 +2025,7 @@ static PyObject *__pyx_pf_3fa2_7fa2util_4Node_6old_dy___get__(struct __pyx_obj_3 PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->old_dy); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 20, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->old_dy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -2051,7 +2060,7 @@ static int __pyx_pf_3fa2_7fa2util_4Node_6old_dy_2__set__(struct __pyx_obj_3fa2_7 __Pyx_RefNannyDeclarations double __pyx_t_1; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 20, __pyx_L1_error) + __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 20, __pyx_L1_error) __pyx_v_self->old_dy = __pyx_t_1; /* function exit code */ @@ -2092,7 +2101,7 @@ static PyObject *__pyx_pf_3fa2_7fa2util_4Node_2dx___get__(struct __pyx_obj_3fa2_ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->dx); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 21, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->dx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -2127,7 +2136,7 @@ static int __pyx_pf_3fa2_7fa2util_4Node_2dx_2__set__(struct __pyx_obj_3fa2_7fa2u __Pyx_RefNannyDeclarations double __pyx_t_1; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 21, __pyx_L1_error) + __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 21, __pyx_L1_error) __pyx_v_self->dx = __pyx_t_1; /* function exit code */ @@ -2160,7 +2169,7 @@ static PyObject *__pyx_pf_3fa2_7fa2util_4Node_2dy___get__(struct __pyx_obj_3fa2_ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->dy); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 21, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->dy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -2195,7 +2204,7 @@ static int __pyx_pf_3fa2_7fa2util_4Node_2dy_2__set__(struct __pyx_obj_3fa2_7fa2u __Pyx_RefNannyDeclarations double __pyx_t_1; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 21, __pyx_L1_error) + __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 21, __pyx_L1_error) __pyx_v_self->dy = __pyx_t_1; /* function exit code */ @@ -2236,7 +2245,7 @@ static PyObject *__pyx_pf_3fa2_7fa2util_4Node_1x___get__(struct __pyx_obj_3fa2_7 PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 22, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -2271,7 +2280,7 @@ static int __pyx_pf_3fa2_7fa2util_4Node_1x_2__set__(struct __pyx_obj_3fa2_7fa2ut __Pyx_RefNannyDeclarations double __pyx_t_1; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 22, __pyx_L1_error) + __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 22, __pyx_L1_error) __pyx_v_self->x = __pyx_t_1; /* function exit code */ @@ -2304,7 +2313,7 @@ static PyObject *__pyx_pf_3fa2_7fa2util_4Node_1y___get__(struct __pyx_obj_3fa2_7 PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->y); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 22, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -2339,7 +2348,7 @@ static int __pyx_pf_3fa2_7fa2util_4Node_1y_2__set__(struct __pyx_obj_3fa2_7fa2ut __Pyx_RefNannyDeclarations double __pyx_t_1; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 22, __pyx_L1_error) + __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 22, __pyx_L1_error) __pyx_v_self->y = __pyx_t_1; /* function exit code */ @@ -2398,21 +2407,21 @@ static PyObject *__pyx_pf_3fa2_7fa2util_4Node_2__reduce_cython__(struct __pyx_ob * _dict = getattr(self, '__dict__', None) * if _dict is not None: */ - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->dx); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->dx); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->dy); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->dy); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->mass); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->mass); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->old_dx); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error) + __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->old_dx); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyFloat_FromDouble(__pyx_v_self->old_dy); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 5, __pyx_L1_error) + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_self->old_dy); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyFloat_FromDouble(__pyx_v_self->x); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 5, __pyx_L1_error) + __pyx_t_6 = PyFloat_FromDouble(__pyx_v_self->x); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyFloat_FromDouble(__pyx_v_self->y); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 5, __pyx_L1_error) + __pyx_t_7 = PyFloat_FromDouble(__pyx_v_self->y); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyTuple_New(7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 5, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); @@ -2445,7 +2454,7 @@ static PyObject *__pyx_pf_3fa2_7fa2util_4Node_2__reduce_cython__(struct __pyx_ob * if _dict is not None: * state += (_dict,) */ - __pyx_t_8 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 6, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v__dict = __pyx_t_8; __pyx_t_8 = 0; @@ -2468,12 +2477,12 @@ static PyObject *__pyx_pf_3fa2_7fa2util_4Node_2__reduce_cython__(struct __pyx_ob * use_setstate = True * else: */ - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 8, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v__dict); __Pyx_GIVEREF(__pyx_v__dict); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v__dict); - __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 8, __pyx_L1_error) + __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_7)); @@ -2528,9 +2537,9 @@ static PyObject *__pyx_pf_3fa2_7fa2util_4Node_2__reduce_cython__(struct __pyx_ob * return __pyx_unpickle_Node, (type(self), 0x2f233dd, state) */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_pyx_unpickle_Node); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 13, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_pyx_unpickle_Node); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 13, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); @@ -2541,7 +2550,7 @@ static PyObject *__pyx_pf_3fa2_7fa2util_4Node_2__reduce_cython__(struct __pyx_ob __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_8, 2, Py_None); - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 13, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); @@ -2574,9 +2583,9 @@ static PyObject *__pyx_pf_3fa2_7fa2util_4Node_2__reduce_cython__(struct __pyx_ob */ /*else*/ { __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pyx_unpickle_Node); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 15, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pyx_unpickle_Node); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 15, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); @@ -2587,7 +2596,7 @@ static PyObject *__pyx_pf_3fa2_7fa2util_4Node_2__reduce_cython__(struct __pyx_ob __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_state); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 15, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); @@ -2658,8 +2667,8 @@ static PyObject *__pyx_pf_3fa2_7fa2util_4Node_4__setstate_cython__(struct __pyx_ * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_Node__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ - if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 17, __pyx_L1_error) - __pyx_t_1 = __pyx_f_3fa2_7fa2util___pyx_unpickle_Node__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error) + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error) + __pyx_t_1 = __pyx_f_3fa2_7fa2util___pyx_unpickle_Node__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -2780,7 +2789,7 @@ static PyObject *__pyx_pf_3fa2_7fa2util_4Edge_5node1___get__(struct __pyx_obj_3f PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->node1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 27, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->node1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -2815,7 +2824,7 @@ static int __pyx_pf_3fa2_7fa2util_4Edge_5node1_2__set__(struct __pyx_obj_3fa2_7f __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 27, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 27, __pyx_L1_error) __pyx_v_self->node1 = __pyx_t_1; /* function exit code */ @@ -2848,7 +2857,7 @@ static PyObject *__pyx_pf_3fa2_7fa2util_4Edge_5node2___get__(struct __pyx_obj_3f PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->node2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 27, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->node2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -2883,7 +2892,7 @@ static int __pyx_pf_3fa2_7fa2util_4Edge_5node2_2__set__(struct __pyx_obj_3fa2_7f __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 27, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 27, __pyx_L1_error) __pyx_v_self->node2 = __pyx_t_1; /* function exit code */ @@ -2924,7 +2933,7 @@ static PyObject *__pyx_pf_3fa2_7fa2util_4Edge_6weight___get__(struct __pyx_obj_3 PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->weight); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 28, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->weight); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -2959,7 +2968,7 @@ static int __pyx_pf_3fa2_7fa2util_4Edge_6weight_2__set__(struct __pyx_obj_3fa2_7 __Pyx_RefNannyDeclarations double __pyx_t_1; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 28, __pyx_L1_error) + __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 28, __pyx_L1_error) __pyx_v_self->weight = __pyx_t_1; /* function exit code */ @@ -3014,13 +3023,13 @@ static PyObject *__pyx_pf_3fa2_7fa2util_4Edge_2__reduce_cython__(struct __pyx_ob * _dict = getattr(self, '__dict__', None) * if _dict is not None: */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->node1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->node1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->node2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->node2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->weight); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->weight); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); @@ -3041,7 +3050,7 @@ static PyObject *__pyx_pf_3fa2_7fa2util_4Edge_2__reduce_cython__(struct __pyx_ob * if _dict is not None: * state += (_dict,) */ - __pyx_t_4 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v__dict = __pyx_t_4; __pyx_t_4 = 0; @@ -3064,12 +3073,12 @@ static PyObject *__pyx_pf_3fa2_7fa2util_4Edge_2__reduce_cython__(struct __pyx_ob * use_setstate = True * else: */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 8, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v__dict); __Pyx_GIVEREF(__pyx_v__dict); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v__dict); - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 8, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3)); @@ -3124,9 +3133,9 @@ static PyObject *__pyx_pf_3fa2_7fa2util_4Edge_2__reduce_cython__(struct __pyx_ob * return __pyx_unpickle_Edge, (type(self), 0xb469544, state) */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_Edge); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 13, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_Edge); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); @@ -3137,7 +3146,7 @@ static PyObject *__pyx_pf_3fa2_7fa2util_4Edge_2__reduce_cython__(struct __pyx_ob __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_4, 2, Py_None); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 13, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); @@ -3170,9 +3179,9 @@ static PyObject *__pyx_pf_3fa2_7fa2util_4Edge_2__reduce_cython__(struct __pyx_ob */ /*else*/ { __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pyx_unpickle_Edge); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 15, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pyx_unpickle_Edge); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 15, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); @@ -3183,7 +3192,7 @@ static PyObject *__pyx_pf_3fa2_7fa2util_4Edge_2__reduce_cython__(struct __pyx_ob __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 15, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); @@ -3250,8 +3259,8 @@ static PyObject *__pyx_pf_3fa2_7fa2util_4Edge_4__setstate_cython__(struct __pyx_ * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_Edge__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ - if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 17, __pyx_L1_error) - __pyx_t_1 = __pyx_f_3fa2_7fa2util___pyx_unpickle_Edge__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error) + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error) + __pyx_t_1 = __pyx_f_3fa2_7fa2util___pyx_unpickle_Edge__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -3346,7 +3355,7 @@ static void __pyx_f_3fa2_7fa2util_linRepulsion(struct __pyx_obj_3fa2_7fa2util_No __pyx_t_2 = ((__pyx_v_coefficient * __pyx_v_n1->mass) * __pyx_v_n2->mass); if (unlikely(__pyx_v_distance2 == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 47, __pyx_L1_error) + __PYX_ERR(2, 47, __pyx_L1_error) } __pyx_v_factor = (__pyx_t_2 / __pyx_v_distance2); @@ -3482,7 +3491,7 @@ static void __pyx_f_3fa2_7fa2util_linRepulsion_region(struct __pyx_obj_3fa2_7fa2 __pyx_t_2 = ((__pyx_v_coefficient * __pyx_v_n->mass) * __pyx_v_r->mass); if (unlikely(__pyx_v_distance2 == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 61, __pyx_L1_error) + __PYX_ERR(2, 61, __pyx_L1_error) } __pyx_v_factor = (__pyx_t_2 / __pyx_v_distance2); @@ -3578,9 +3587,9 @@ static void __pyx_f_3fa2_7fa2util_linGravity(struct __pyx_obj_3fa2_7fa2util_Node * * if distance > 0: */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 74, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyFloat_FromDouble(((__pyx_v_xDist * __pyx_v_xDist) + (__pyx_v_yDist * __pyx_v_yDist))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 74, __pyx_L1_error) + __pyx_t_4 = PyFloat_FromDouble(((__pyx_v_xDist * __pyx_v_xDist) + (__pyx_v_yDist * __pyx_v_yDist))); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -3595,10 +3604,10 @@ static void __pyx_f_3fa2_7fa2util_linGravity(struct __pyx_obj_3fa2_7fa2util_Node __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 74, __pyx_L1_error) + __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 74, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_distance = __pyx_t_1; @@ -3622,7 +3631,7 @@ static void __pyx_f_3fa2_7fa2util_linGravity(struct __pyx_obj_3fa2_7fa2util_Node __pyx_t_1 = (__pyx_v_n->mass * __pyx_v_g); if (unlikely(__pyx_v_distance == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 77, __pyx_L1_error) + __PYX_ERR(2, 77, __pyx_L1_error) } __pyx_v_factor = (__pyx_t_1 / __pyx_v_distance); @@ -3865,7 +3874,7 @@ static void __pyx_f_3fa2_7fa2util_linAttraction(struct __pyx_obj_3fa2_7fa2util_N __pyx_t_2 = ((-__pyx_v_coefficient) * __pyx_v_e); if (unlikely(__pyx_v_n1->mass == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 103, __pyx_L1_error) + __PYX_ERR(2, 103, __pyx_L1_error) } __pyx_v_factor = (__pyx_t_2 / __pyx_v_n1->mass); } @@ -3964,19 +3973,19 @@ static PyObject *__pyx_pw_3fa2_7fa2util_1linAttraction(PyObject *__pyx_self, PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n2)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("linAttraction", 0, 4, 5, 1); __PYX_ERR(0, 97, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("linAttraction", 0, 4, 5, 1); __PYX_ERR(2, 97, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_e)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("linAttraction", 0, 4, 5, 2); __PYX_ERR(0, 97, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("linAttraction", 0, 4, 5, 2); __PYX_ERR(2, 97, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_distributedAttraction)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("linAttraction", 0, 4, 5, 3); __PYX_ERR(0, 97, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("linAttraction", 0, 4, 5, 3); __PYX_ERR(2, 97, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: @@ -3986,7 +3995,7 @@ static PyObject *__pyx_pw_3fa2_7fa2util_1linAttraction(PyObject *__pyx_self, PyO } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "linAttraction") < 0)) __PYX_ERR(0, 97, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "linAttraction") < 0)) __PYX_ERR(2, 97, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -4002,24 +4011,24 @@ static PyObject *__pyx_pw_3fa2_7fa2util_1linAttraction(PyObject *__pyx_self, PyO } __pyx_v_n1 = ((struct __pyx_obj_3fa2_7fa2util_Node *)values[0]); __pyx_v_n2 = ((struct __pyx_obj_3fa2_7fa2util_Node *)values[1]); - __pyx_v_e = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_e == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 97, __pyx_L3_error) - __pyx_v_distributedAttraction = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_distributedAttraction == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 97, __pyx_L3_error) + __pyx_v_e = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_e == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 97, __pyx_L3_error) + __pyx_v_distributedAttraction = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_distributedAttraction == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 97, __pyx_L3_error) if (values[4]) { - __pyx_v_coefficient = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_coefficient == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 97, __pyx_L3_error) + __pyx_v_coefficient = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_coefficient == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 97, __pyx_L3_error) } else { __pyx_v_coefficient = ((double)0.0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("linAttraction", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 97, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("linAttraction", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 97, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fa2.fa2util.linAttraction", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_n1), __pyx_ptype_3fa2_7fa2util_Node, 1, "n1", 0))) __PYX_ERR(0, 97, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_n2), __pyx_ptype_3fa2_7fa2util_Node, 1, "n2", 0))) __PYX_ERR(0, 97, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_n1), __pyx_ptype_3fa2_7fa2util_Node, 1, "n1", 0))) __PYX_ERR(2, 97, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_n2), __pyx_ptype_3fa2_7fa2util_Node, 1, "n2", 0))) __PYX_ERR(2, 97, __pyx_L1_error) __pyx_r = __pyx_pf_3fa2_7fa2util_linAttraction(__pyx_self, __pyx_v_n1, __pyx_v_n2, __pyx_v_e, __pyx_v_distributedAttraction, __pyx_v_coefficient); /* function exit code */ @@ -4041,7 +4050,7 @@ static PyObject *__pyx_pf_3fa2_7fa2util_linAttraction(CYTHON_UNUSED PyObject *__ __pyx_t_1.__pyx_n = 1; __pyx_t_1.coefficient = __pyx_v_coefficient; __pyx_f_3fa2_7fa2util_linAttraction(__pyx_v_n1, __pyx_v_n2, __pyx_v_e, __pyx_v_distributedAttraction, 0, &__pyx_t_1); - __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -4100,18 +4109,18 @@ static void __pyx_f_3fa2_7fa2util_apply_repulsion(PyObject *__pyx_v_nodes, doubl */ if (unlikely(__pyx_v_nodes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 115, __pyx_L1_error) + __PYX_ERR(2, 115, __pyx_L1_error) } __pyx_t_1 = __pyx_v_nodes; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 115, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(2, 115, __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(0, 115, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(0, 115, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(2, 115, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_n1, ((struct __pyx_obj_3fa2_7fa2util_Node *)__pyx_t_3)); __pyx_t_3 = 0; @@ -4133,18 +4142,18 @@ static void __pyx_f_3fa2_7fa2util_apply_repulsion(PyObject *__pyx_v_nodes, doubl */ if (unlikely(__pyx_v_nodes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 117, __pyx_L1_error) + __PYX_ERR(2, 117, __pyx_L1_error) } __pyx_t_3 = __pyx_v_nodes; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; for (;;) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 117, __pyx_L1_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(2, 117, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 117, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(0, 117, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(2, 117, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_n2, ((struct __pyx_obj_3fa2_7fa2util_Node *)__pyx_t_5)); __pyx_t_5 = 0; @@ -4279,11 +4288,11 @@ static PyObject *__pyx_pw_3fa2_7fa2util_3apply_repulsion(PyObject *__pyx_self, P case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coefficient)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("apply_repulsion", 1, 2, 2, 1); __PYX_ERR(0, 113, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("apply_repulsion", 1, 2, 2, 1); __PYX_ERR(2, 113, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "apply_repulsion") < 0)) __PYX_ERR(0, 113, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "apply_repulsion") < 0)) __PYX_ERR(2, 113, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -4292,17 +4301,17 @@ static PyObject *__pyx_pw_3fa2_7fa2util_3apply_repulsion(PyObject *__pyx_self, P values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_nodes = ((PyObject*)values[0]); - __pyx_v_coefficient = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_coefficient == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 113, __pyx_L3_error) + __pyx_v_coefficient = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_coefficient == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 113, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("apply_repulsion", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 113, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("apply_repulsion", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 113, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fa2.fa2util.apply_repulsion", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodes), (&PyList_Type), 1, "nodes", 1))) __PYX_ERR(0, 113, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodes), (&PyList_Type), 1, "nodes", 1))) __PYX_ERR(2, 113, __pyx_L1_error) __pyx_r = __pyx_pf_3fa2_7fa2util_2apply_repulsion(__pyx_self, __pyx_v_nodes, __pyx_v_coefficient); /* function exit code */ @@ -4320,7 +4329,7 @@ static PyObject *__pyx_pf_3fa2_7fa2util_2apply_repulsion(CYTHON_UNUSED PyObject PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("apply_repulsion", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_void_to_None(__pyx_f_3fa2_7fa2util_apply_repulsion(__pyx_v_nodes, __pyx_v_coefficient, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error) + __pyx_t_1 = __Pyx_void_to_None(__pyx_f_3fa2_7fa2util_apply_repulsion(__pyx_v_nodes, __pyx_v_coefficient, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -4381,18 +4390,18 @@ static void __pyx_f_3fa2_7fa2util_apply_gravity(PyObject *__pyx_v_nodes, double */ if (unlikely(__pyx_v_nodes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 127, __pyx_L1_error) + __PYX_ERR(2, 127, __pyx_L1_error) } __pyx_t_2 = __pyx_v_nodes; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; for (;;) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 127, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(0, 127, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(2, 127, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_n, ((struct __pyx_obj_3fa2_7fa2util_Node *)__pyx_t_4)); __pyx_t_4 = 0; @@ -4435,18 +4444,18 @@ static void __pyx_f_3fa2_7fa2util_apply_gravity(PyObject *__pyx_v_nodes, double /*else*/ { if (unlikely(__pyx_v_nodes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 130, __pyx_L1_error) + __PYX_ERR(2, 130, __pyx_L1_error) } __pyx_t_2 = __pyx_v_nodes; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; for (;;) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 130, __pyx_L1_error) + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 130, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 130, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(0, 130, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(2, 130, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_n, ((struct __pyx_obj_3fa2_7fa2util_Node *)__pyx_t_4)); __pyx_t_4 = 0; @@ -4530,13 +4539,13 @@ static PyObject *__pyx_pw_3fa2_7fa2util_5apply_gravity(PyObject *__pyx_self, PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gravity)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("apply_gravity", 0, 3, 4, 1); __PYX_ERR(0, 125, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("apply_gravity", 0, 3, 4, 1); __PYX_ERR(2, 125, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_scalingRatio)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("apply_gravity", 0, 3, 4, 2); __PYX_ERR(0, 125, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("apply_gravity", 0, 3, 4, 2); __PYX_ERR(2, 125, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: @@ -4546,7 +4555,7 @@ static PyObject *__pyx_pw_3fa2_7fa2util_5apply_gravity(PyObject *__pyx_self, PyO } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "apply_gravity") < 0)) __PYX_ERR(0, 125, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "apply_gravity") < 0)) __PYX_ERR(2, 125, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -4560,23 +4569,23 @@ static PyObject *__pyx_pw_3fa2_7fa2util_5apply_gravity(PyObject *__pyx_self, PyO } } __pyx_v_nodes = ((PyObject*)values[0]); - __pyx_v_gravity = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_gravity == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 125, __pyx_L3_error) - __pyx_v_scalingRatio = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_scalingRatio == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 125, __pyx_L3_error) + __pyx_v_gravity = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_gravity == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 125, __pyx_L3_error) + __pyx_v_scalingRatio = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_scalingRatio == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 125, __pyx_L3_error) if (values[3]) { - __pyx_v_useStrongGravity = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_useStrongGravity == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 125, __pyx_L3_error) + __pyx_v_useStrongGravity = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_useStrongGravity == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 125, __pyx_L3_error) } else { __pyx_v_useStrongGravity = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("apply_gravity", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 125, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("apply_gravity", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 125, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fa2.fa2util.apply_gravity", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodes), (&PyList_Type), 1, "nodes", 1))) __PYX_ERR(0, 125, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodes), (&PyList_Type), 1, "nodes", 1))) __PYX_ERR(2, 125, __pyx_L1_error) __pyx_r = __pyx_pf_3fa2_7fa2util_4apply_gravity(__pyx_self, __pyx_v_nodes, __pyx_v_gravity, __pyx_v_scalingRatio, __pyx_v_useStrongGravity); /* function exit code */ @@ -4598,7 +4607,7 @@ static PyObject *__pyx_pf_3fa2_7fa2util_4apply_gravity(CYTHON_UNUSED PyObject *_ __pyx_t_1.__pyx_n = 1; __pyx_t_1.useStrongGravity = __pyx_v_useStrongGravity; __pyx_f_3fa2_7fa2util_apply_gravity(__pyx_v_nodes, __pyx_v_gravity, __pyx_v_scalingRatio, 0, &__pyx_t_1); - __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -4658,18 +4667,18 @@ static void __pyx_f_3fa2_7fa2util_apply_attraction(PyObject *__pyx_v_nodes, PyOb */ if (unlikely(__pyx_v_edges == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 137, __pyx_L1_error) + __PYX_ERR(2, 137, __pyx_L1_error) } __pyx_t_2 = __pyx_v_edges; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; for (;;) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 137, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_3fa2_7fa2util_Edge))))) __PYX_ERR(0, 137, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_3fa2_7fa2util_Edge))))) __PYX_ERR(2, 137, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_edge, ((struct __pyx_obj_3fa2_7fa2util_Edge *)__pyx_t_4)); __pyx_t_4 = 0; @@ -4682,18 +4691,18 @@ static void __pyx_f_3fa2_7fa2util_apply_attraction(PyObject *__pyx_v_nodes, PyOb */ if (unlikely(__pyx_v_nodes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 138, __pyx_L1_error) + __PYX_ERR(2, 138, __pyx_L1_error) } - __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_nodes, __pyx_v_edge->node1, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 138, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_nodes, __pyx_v_edge->node1, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(0, 138, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(2, 138, __pyx_L1_error) if (unlikely(__pyx_v_nodes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 138, __pyx_L1_error) + __PYX_ERR(2, 138, __pyx_L1_error) } - __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_nodes, __pyx_v_edge->node2, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 138, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_nodes, __pyx_v_edge->node2, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(0, 138, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(2, 138, __pyx_L1_error) __pyx_t_6.__pyx_n = 1; __pyx_t_6.coefficient = __pyx_v_coefficient; __pyx_f_3fa2_7fa2util_linAttraction(((struct __pyx_obj_3fa2_7fa2util_Node *)__pyx_t_4), ((struct __pyx_obj_3fa2_7fa2util_Node *)__pyx_t_5), 1.0, __pyx_v_distributedAttraction, 0, &__pyx_t_6); @@ -4739,18 +4748,18 @@ static void __pyx_f_3fa2_7fa2util_apply_attraction(PyObject *__pyx_v_nodes, PyOb */ if (unlikely(__pyx_v_edges == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 140, __pyx_L1_error) + __PYX_ERR(2, 140, __pyx_L1_error) } __pyx_t_2 = __pyx_v_edges; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; for (;;) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 140, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_3fa2_7fa2util_Edge))))) __PYX_ERR(0, 140, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_3fa2_7fa2util_Edge))))) __PYX_ERR(2, 140, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_edge, ((struct __pyx_obj_3fa2_7fa2util_Edge *)__pyx_t_5)); __pyx_t_5 = 0; @@ -4763,18 +4772,18 @@ static void __pyx_f_3fa2_7fa2util_apply_attraction(PyObject *__pyx_v_nodes, PyOb */ if (unlikely(__pyx_v_nodes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 141, __pyx_L1_error) + __PYX_ERR(2, 141, __pyx_L1_error) } - __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_nodes, __pyx_v_edge->node1, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_nodes, __pyx_v_edge->node1, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(0, 141, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(2, 141, __pyx_L1_error) if (unlikely(__pyx_v_nodes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 141, __pyx_L1_error) + __PYX_ERR(2, 141, __pyx_L1_error) } - __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_nodes, __pyx_v_edge->node2, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_nodes, __pyx_v_edge->node2, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(0, 141, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(2, 141, __pyx_L1_error) __pyx_t_6.__pyx_n = 1; __pyx_t_6.coefficient = __pyx_v_coefficient; __pyx_f_3fa2_7fa2util_linAttraction(((struct __pyx_obj_3fa2_7fa2util_Node *)__pyx_t_5), ((struct __pyx_obj_3fa2_7fa2util_Node *)__pyx_t_4), __pyx_v_edge->weight, __pyx_v_distributedAttraction, 0, &__pyx_t_6); @@ -4811,18 +4820,18 @@ static void __pyx_f_3fa2_7fa2util_apply_attraction(PyObject *__pyx_v_nodes, PyOb /*else*/ { if (unlikely(__pyx_v_edges == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 143, __pyx_L1_error) + __PYX_ERR(2, 143, __pyx_L1_error) } __pyx_t_2 = __pyx_v_edges; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; for (;;) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 143, __pyx_L1_error) + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 143, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 143, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_3fa2_7fa2util_Edge))))) __PYX_ERR(0, 143, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_3fa2_7fa2util_Edge))))) __PYX_ERR(2, 143, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_edge, ((struct __pyx_obj_3fa2_7fa2util_Edge *)__pyx_t_4)); __pyx_t_4 = 0; @@ -4835,27 +4844,27 @@ static void __pyx_f_3fa2_7fa2util_apply_attraction(PyObject *__pyx_v_nodes, PyOb */ if (unlikely(__pyx_v_nodes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 144, __pyx_L1_error) + __PYX_ERR(2, 144, __pyx_L1_error) } - __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_nodes, __pyx_v_edge->node1, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_nodes, __pyx_v_edge->node1, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(0, 144, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(2, 144, __pyx_L1_error) if (unlikely(__pyx_v_nodes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 144, __pyx_L1_error) + __PYX_ERR(2, 144, __pyx_L1_error) } - __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_nodes, __pyx_v_edge->node2, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_nodes, __pyx_v_edge->node2, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(0, 144, __pyx_L1_error) - __pyx_t_7 = PyFloat_FromDouble(__pyx_v_edge->weight); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 144, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(2, 144, __pyx_L1_error) + __pyx_t_7 = PyFloat_FromDouble(__pyx_v_edge->weight); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyFloat_FromDouble(__pyx_v_edgeWeightInfluence); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_8 = PyFloat_FromDouble(__pyx_v_edgeWeightInfluence); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyNumber_Power2(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyNumber_Power2(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_9); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_9); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 144, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "fa2/fa2util.py":145 @@ -4947,29 +4956,29 @@ static PyObject *__pyx_pw_3fa2_7fa2util_7apply_attraction(PyObject *__pyx_self, case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edges)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("apply_attraction", 1, 5, 5, 1); __PYX_ERR(0, 134, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("apply_attraction", 1, 5, 5, 1); __PYX_ERR(2, 134, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_distributedAttraction)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("apply_attraction", 1, 5, 5, 2); __PYX_ERR(0, 134, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("apply_attraction", 1, 5, 5, 2); __PYX_ERR(2, 134, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coefficient)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("apply_attraction", 1, 5, 5, 3); __PYX_ERR(0, 134, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("apply_attraction", 1, 5, 5, 3); __PYX_ERR(2, 134, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edgeWeightInfluence)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("apply_attraction", 1, 5, 5, 4); __PYX_ERR(0, 134, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("apply_attraction", 1, 5, 5, 4); __PYX_ERR(2, 134, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "apply_attraction") < 0)) __PYX_ERR(0, 134, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "apply_attraction") < 0)) __PYX_ERR(2, 134, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -4982,20 +4991,20 @@ static PyObject *__pyx_pw_3fa2_7fa2util_7apply_attraction(PyObject *__pyx_self, } __pyx_v_nodes = ((PyObject*)values[0]); __pyx_v_edges = ((PyObject*)values[1]); - __pyx_v_distributedAttraction = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_distributedAttraction == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) - __pyx_v_coefficient = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_coefficient == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) - __pyx_v_edgeWeightInfluence = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_edgeWeightInfluence == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) + __pyx_v_distributedAttraction = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_distributedAttraction == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 134, __pyx_L3_error) + __pyx_v_coefficient = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_coefficient == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 134, __pyx_L3_error) + __pyx_v_edgeWeightInfluence = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_edgeWeightInfluence == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 134, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("apply_attraction", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 134, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("apply_attraction", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 134, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fa2.fa2util.apply_attraction", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodes), (&PyList_Type), 1, "nodes", 1))) __PYX_ERR(0, 134, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edges), (&PyList_Type), 1, "edges", 1))) __PYX_ERR(0, 134, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodes), (&PyList_Type), 1, "nodes", 1))) __PYX_ERR(2, 134, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edges), (&PyList_Type), 1, "edges", 1))) __PYX_ERR(2, 134, __pyx_L1_error) __pyx_r = __pyx_pf_3fa2_7fa2util_6apply_attraction(__pyx_self, __pyx_v_nodes, __pyx_v_edges, __pyx_v_distributedAttraction, __pyx_v_coefficient, __pyx_v_edgeWeightInfluence); /* function exit code */ @@ -5013,7 +5022,7 @@ static PyObject *__pyx_pf_3fa2_7fa2util_6apply_attraction(CYTHON_UNUSED PyObject PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("apply_attraction", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_void_to_None(__pyx_f_3fa2_7fa2util_apply_attraction(__pyx_v_nodes, __pyx_v_edges, __pyx_v_distributedAttraction, __pyx_v_coefficient, __pyx_v_edgeWeightInfluence, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error) + __pyx_t_1 = __Pyx_void_to_None(__pyx_f_3fa2_7fa2util_apply_attraction(__pyx_v_nodes, __pyx_v_edges, __pyx_v_distributedAttraction, __pyx_v_coefficient, __pyx_v_edgeWeightInfluence, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -5064,7 +5073,7 @@ static int __pyx_pw_3fa2_7fa2util_6Region_1__init__(PyObject *__pyx_v_self, PyOb else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 150, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 150, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -5075,7 +5084,7 @@ static int __pyx_pw_3fa2_7fa2util_6Region_1__init__(PyObject *__pyx_v_self, PyOb } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 150, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 150, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fa2.fa2util.Region.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -5137,7 +5146,7 @@ static int __pyx_pf_3fa2_7fa2util_6Region___init__(struct __pyx_obj_3fa2_7fa2uti * self.subregions = [] * self.updateMassAndGeometry() */ - if (!(likely(PyList_CheckExact(__pyx_v_nodes))||((__pyx_v_nodes) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_nodes)->tp_name), 0))) __PYX_ERR(0, 155, __pyx_L1_error) + if (!(likely(PyList_CheckExact(__pyx_v_nodes))||((__pyx_v_nodes) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_nodes)->tp_name), 0))) __PYX_ERR(2, 155, __pyx_L1_error) __pyx_t_1 = __pyx_v_nodes; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -5153,7 +5162,7 @@ static int __pyx_pf_3fa2_7fa2util_6Region___init__(struct __pyx_obj_3fa2_7fa2uti * self.updateMassAndGeometry() * */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->subregions); @@ -5227,9 +5236,9 @@ static void __pyx_f_3fa2_7fa2util_6Region_updateMassAndGeometry(struct __pyx_obj __Pyx_INCREF(__pyx_t_1); if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 160, __pyx_L1_error) + __PYX_ERR(2, 160, __pyx_L1_error) } - __pyx_t_2 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_2 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(2, 160, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((__pyx_t_2 > 1) != 0); if (__pyx_t_3) { @@ -5270,18 +5279,18 @@ static void __pyx_f_3fa2_7fa2util_6Region_updateMassAndGeometry(struct __pyx_obj */ if (unlikely(__pyx_v_self->nodes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 164, __pyx_L1_error) + __PYX_ERR(2, 164, __pyx_L1_error) } __pyx_t_1 = __pyx_v_self->nodes; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(2, 164, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(0, 164, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(2, 164, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_n, ((struct __pyx_obj_3fa2_7fa2util_Node *)__pyx_t_4)); __pyx_t_4 = 0; @@ -5331,7 +5340,7 @@ static void __pyx_f_3fa2_7fa2util_6Region_updateMassAndGeometry(struct __pyx_obj */ if (unlikely(__pyx_v_self->mass == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 168, __pyx_L1_error) + __PYX_ERR(2, 168, __pyx_L1_error) } __pyx_v_self->massCenterX = (__pyx_v_massSumX / __pyx_v_self->mass); @@ -5344,7 +5353,7 @@ static void __pyx_f_3fa2_7fa2util_6Region_updateMassAndGeometry(struct __pyx_obj */ if (unlikely(__pyx_v_self->mass == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 169, __pyx_L1_error) + __PYX_ERR(2, 169, __pyx_L1_error) } __pyx_v_self->massCenterY = (__pyx_v_massSumY / __pyx_v_self->mass); @@ -5366,18 +5375,18 @@ static void __pyx_f_3fa2_7fa2util_6Region_updateMassAndGeometry(struct __pyx_obj */ if (unlikely(__pyx_v_self->nodes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 172, __pyx_L1_error) + __PYX_ERR(2, 172, __pyx_L1_error) } __pyx_t_1 = __pyx_v_self->nodes; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(2, 172, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(0, 172, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(2, 172, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_n, ((struct __pyx_obj_3fa2_7fa2util_Node *)__pyx_t_4)); __pyx_t_4 = 0; @@ -5388,9 +5397,9 @@ static void __pyx_f_3fa2_7fa2util_6Region_updateMassAndGeometry(struct __pyx_obj * self.size = max(self.size, 2 * distance) * */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 173, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyFloat_FromDouble((pow((__pyx_v_n->x - __pyx_v_self->massCenterX), 2.0) + pow((__pyx_v_n->y - __pyx_v_self->massCenterY), 2.0))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 173, __pyx_L1_error) + __pyx_t_6 = PyFloat_FromDouble((pow((__pyx_v_n->x - __pyx_v_self->massCenterX), 2.0) + pow((__pyx_v_n->y - __pyx_v_self->massCenterY), 2.0))); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -5405,10 +5414,10 @@ static void __pyx_f_3fa2_7fa2util_6Region_updateMassAndGeometry(struct __pyx_obj __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 173, __pyx_L1_error) + __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 173, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_distance = __pyx_t_8; @@ -5474,14 +5483,12 @@ static void __pyx_f_3fa2_7fa2util_6Region_updateMassAndGeometry(struct __pyx_obj * * def buildSubRegions(self): # <<<<<<<<<<<<<< * if len(self.nodes) > 1: - * + * topleftNodes = [] */ static PyObject *__pyx_pw_3fa2_7fa2util_6Region_3buildSubRegions(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static void __pyx_f_3fa2_7fa2util_6Region_buildSubRegions(struct __pyx_obj_3fa2_7fa2util_Region *__pyx_v_self, int __pyx_skip_dispatch) { struct __pyx_obj_3fa2_7fa2util_Node *__pyx_v_n = 0; - PyObject *__pyx_v_leftNodes = 0; - PyObject *__pyx_v_rightNodes = 0; PyObject *__pyx_v_topleftNodes = 0; PyObject *__pyx_v_bottomleftNodes = 0; PyObject *__pyx_v_toprightNodes = 0; @@ -5506,7 +5513,7 @@ static void __pyx_f_3fa2_7fa2util_6Region_buildSubRegions(struct __pyx_obj_3fa2_ if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_buildSubRegions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_buildSubRegions); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_3fa2_7fa2util_6Region_3buildSubRegions)) { __Pyx_INCREF(__pyx_t_1); @@ -5522,7 +5529,7 @@ static void __pyx_f_3fa2_7fa2util_6Region_buildSubRegions(struct __pyx_obj_3fa2_ } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 176, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -5546,352 +5553,250 @@ static void __pyx_f_3fa2_7fa2util_6Region_buildSubRegions(struct __pyx_obj_3fa2_ * * def buildSubRegions(self): * if len(self.nodes) > 1: # <<<<<<<<<<<<<< - * - * leftNodes = [] + * topleftNodes = [] + * bottomleftNodes = [] */ __pyx_t_1 = __pyx_v_self->nodes; __Pyx_INCREF(__pyx_t_1); if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 177, __pyx_L1_error) + __PYX_ERR(2, 177, __pyx_L1_error) } - __pyx_t_5 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 177, __pyx_L1_error) + __pyx_t_5 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 177, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = ((__pyx_t_5 > 1) != 0); if (__pyx_t_6) { + /* "fa2/fa2util.py":178 + * def buildSubRegions(self): + * if len(self.nodes) > 1: + * topleftNodes = [] # <<<<<<<<<<<<<< + * bottomleftNodes = [] + * toprightNodes = [] + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_topleftNodes = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + /* "fa2/fa2util.py":179 * if len(self.nodes) > 1: - * - * leftNodes = [] # <<<<<<<<<<<<<< - * rightNodes = [] - * for n in self.nodes: + * topleftNodes = [] + * bottomleftNodes = [] # <<<<<<<<<<<<<< + * toprightNodes = [] + * bottomrightNodes = [] */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_v_leftNodes = ((PyObject*)__pyx_t_1); + __pyx_v_bottomleftNodes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "fa2/fa2util.py":180 - * - * leftNodes = [] - * rightNodes = [] # <<<<<<<<<<<<<< - * for n in self.nodes: - * if n.x < self.massCenterX: + * topleftNodes = [] + * bottomleftNodes = [] + * toprightNodes = [] # <<<<<<<<<<<<<< + * bottomrightNodes = [] + * # Optimization: The distribution of self.nodes into */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_v_rightNodes = ((PyObject*)__pyx_t_1); + __pyx_v_toprightNodes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "fa2/fa2util.py":181 - * leftNodes = [] - * rightNodes = [] + * bottomleftNodes = [] + * toprightNodes = [] + * bottomrightNodes = [] # <<<<<<<<<<<<<< + * # Optimization: The distribution of self.nodes into + * # subregions now requires only one for loop. Removed + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_bottomrightNodes = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "fa2/fa2util.py":185 + * # subregions now requires only one for loop. Removed + * # topNodes and bottomNodes arrays: memory space saving. * for n in self.nodes: # <<<<<<<<<<<<<< * if n.x < self.massCenterX: - * leftNodes.append(n) + * if n.y < self.massCenterY: */ if (unlikely(__pyx_v_self->nodes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 181, __pyx_L1_error) + __PYX_ERR(2, 185, __pyx_L1_error) } __pyx_t_1 = __pyx_v_self->nodes; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; for (;;) { 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, 181, __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(2, 185, __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, 181, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(0, 181, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(2, 185, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_n, ((struct __pyx_obj_3fa2_7fa2util_Node *)__pyx_t_2)); __pyx_t_2 = 0; - /* "fa2/fa2util.py":182 - * rightNodes = [] + /* "fa2/fa2util.py":186 + * # topNodes and bottomNodes arrays: memory space saving. * for n in self.nodes: * if n.x < self.massCenterX: # <<<<<<<<<<<<<< - * leftNodes.append(n) - * else: + * if n.y < self.massCenterY: + * bottomleftNodes.append(n) */ __pyx_t_6 = ((__pyx_v_n->x < __pyx_v_self->massCenterX) != 0); if (__pyx_t_6) { - /* "fa2/fa2util.py":183 + /* "fa2/fa2util.py":187 * for n in self.nodes: * if n.x < self.massCenterX: - * leftNodes.append(n) # <<<<<<<<<<<<<< - * else: - * rightNodes.append(n) - */ - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_leftNodes, ((PyObject *)__pyx_v_n)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 183, __pyx_L1_error) - - /* "fa2/fa2util.py":182 - * rightNodes = [] - * for n in self.nodes: - * if n.x < self.massCenterX: # <<<<<<<<<<<<<< - * leftNodes.append(n) - * else: - */ - goto __pyx_L6; - } - - /* "fa2/fa2util.py":185 - * leftNodes.append(n) - * else: - * rightNodes.append(n) # <<<<<<<<<<<<<< - * - * topleftNodes = [] + * if n.y < self.massCenterY: # <<<<<<<<<<<<<< + * bottomleftNodes.append(n) + * else: */ - /*else*/ { - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_rightNodes, ((PyObject *)__pyx_v_n)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 185, __pyx_L1_error) - } - __pyx_L6:; + __pyx_t_6 = ((__pyx_v_n->y < __pyx_v_self->massCenterY) != 0); + if (__pyx_t_6) { - /* "fa2/fa2util.py":181 - * leftNodes = [] - * rightNodes = [] - * for n in self.nodes: # <<<<<<<<<<<<<< + /* "fa2/fa2util.py":188 * if n.x < self.massCenterX: - * leftNodes.append(n) - */ - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "fa2/fa2util.py":187 - * rightNodes.append(n) - * - * topleftNodes = [] # <<<<<<<<<<<<<< - * bottomleftNodes = [] - * for n in leftNodes: + * if n.y < self.massCenterY: + * bottomleftNodes.append(n) # <<<<<<<<<<<<<< + * else: + * topleftNodes.append(n) */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_topleftNodes = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_bottomleftNodes, ((PyObject *)__pyx_v_n)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 188, __pyx_L1_error) - /* "fa2/fa2util.py":188 - * - * topleftNodes = [] - * bottomleftNodes = [] # <<<<<<<<<<<<<< - * for n in leftNodes: - * if n.y < self.massCenterY: - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_bottomleftNodes = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "fa2/fa2util.py":189 - * topleftNodes = [] - * bottomleftNodes = [] - * for n in leftNodes: # <<<<<<<<<<<<<< - * if n.y < self.massCenterY: - * topleftNodes.append(n) - */ - __pyx_t_1 = __pyx_v_leftNodes; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; - for (;;) { - 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, 189, __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, 189, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - #endif - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(0, 189, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_n, ((struct __pyx_obj_3fa2_7fa2util_Node *)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "fa2/fa2util.py":190 - * bottomleftNodes = [] - * for n in leftNodes: - * if n.y < self.massCenterY: # <<<<<<<<<<<<<< - * topleftNodes.append(n) - * else: - */ - __pyx_t_6 = ((__pyx_v_n->y < __pyx_v_self->massCenterY) != 0); - if (__pyx_t_6) { - - /* "fa2/fa2util.py":191 - * for n in leftNodes: - * if n.y < self.massCenterY: - * topleftNodes.append(n) # <<<<<<<<<<<<<< - * else: - * bottomleftNodes.append(n) + /* "fa2/fa2util.py":187 + * for n in self.nodes: + * if n.x < self.massCenterX: + * if n.y < self.massCenterY: # <<<<<<<<<<<<<< + * bottomleftNodes.append(n) + * else: */ - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_topleftNodes, ((PyObject *)__pyx_v_n)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 191, __pyx_L1_error) + goto __pyx_L7; + } /* "fa2/fa2util.py":190 - * bottomleftNodes = [] - * for n in leftNodes: - * if n.y < self.massCenterY: # <<<<<<<<<<<<<< - * topleftNodes.append(n) + * bottomleftNodes.append(n) + * else: + * topleftNodes.append(n) # <<<<<<<<<<<<<< * else: + * if n.y < self.massCenterY: */ - goto __pyx_L9; - } + /*else*/ { + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_topleftNodes, ((PyObject *)__pyx_v_n)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 190, __pyx_L1_error) + } + __pyx_L7:; - /* "fa2/fa2util.py":193 - * topleftNodes.append(n) - * else: - * bottomleftNodes.append(n) # <<<<<<<<<<<<<< - * - * toprightNodes = [] + /* "fa2/fa2util.py":186 + * # topNodes and bottomNodes arrays: memory space saving. + * for n in self.nodes: + * if n.x < self.massCenterX: # <<<<<<<<<<<<<< + * if n.y < self.massCenterY: + * bottomleftNodes.append(n) */ - /*else*/ { - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_bottomleftNodes, ((PyObject *)__pyx_v_n)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 193, __pyx_L1_error) + goto __pyx_L6; } - __pyx_L9:; - - /* "fa2/fa2util.py":189 - * topleftNodes = [] - * bottomleftNodes = [] - * for n in leftNodes: # <<<<<<<<<<<<<< - * if n.y < self.massCenterY: - * topleftNodes.append(n) - */ - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "fa2/fa2util.py":195 - * bottomleftNodes.append(n) - * - * toprightNodes = [] # <<<<<<<<<<<<<< - * bottomrightNodes = [] - * for n in rightNodes: - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_toprightNodes = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "fa2/fa2util.py":196 - * - * toprightNodes = [] - * bottomrightNodes = [] # <<<<<<<<<<<<<< - * for n in rightNodes: - * if n.y < self.massCenterY: - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_bottomrightNodes = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "fa2/fa2util.py":197 - * toprightNodes = [] - * bottomrightNodes = [] - * for n in rightNodes: # <<<<<<<<<<<<<< - * if n.y < self.massCenterY: - * toprightNodes.append(n) - */ - __pyx_t_1 = __pyx_v_rightNodes; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; - for (;;) { - 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, 197, __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, 197, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - #endif - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(0, 197, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_n, ((struct __pyx_obj_3fa2_7fa2util_Node *)__pyx_t_2)); - __pyx_t_2 = 0; - /* "fa2/fa2util.py":198 - * bottomrightNodes = [] - * for n in rightNodes: - * if n.y < self.massCenterY: # <<<<<<<<<<<<<< - * toprightNodes.append(n) + /* "fa2/fa2util.py":192 + * topleftNodes.append(n) * else: + * if n.y < self.massCenterY: # <<<<<<<<<<<<<< + * bottomrightNodes.append(n) + * else: */ - __pyx_t_6 = ((__pyx_v_n->y < __pyx_v_self->massCenterY) != 0); - if (__pyx_t_6) { + /*else*/ { + __pyx_t_6 = ((__pyx_v_n->y < __pyx_v_self->massCenterY) != 0); + if (__pyx_t_6) { - /* "fa2/fa2util.py":199 - * for n in rightNodes: - * if n.y < self.massCenterY: - * toprightNodes.append(n) # <<<<<<<<<<<<<< + /* "fa2/fa2util.py":193 * else: - * bottomrightNodes.append(n) + * if n.y < self.massCenterY: + * bottomrightNodes.append(n) # <<<<<<<<<<<<<< + * else: + * toprightNodes.append(n) */ - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_toprightNodes, ((PyObject *)__pyx_v_n)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 199, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_bottomrightNodes, ((PyObject *)__pyx_v_n)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 193, __pyx_L1_error) - /* "fa2/fa2util.py":198 - * bottomrightNodes = [] - * for n in rightNodes: - * if n.y < self.massCenterY: # <<<<<<<<<<<<<< - * toprightNodes.append(n) + /* "fa2/fa2util.py":192 + * topleftNodes.append(n) * else: + * if n.y < self.massCenterY: # <<<<<<<<<<<<<< + * bottomrightNodes.append(n) + * else: */ - goto __pyx_L12; - } + goto __pyx_L8; + } - /* "fa2/fa2util.py":201 - * toprightNodes.append(n) - * else: - * bottomrightNodes.append(n) # <<<<<<<<<<<<<< + /* "fa2/fa2util.py":195 + * bottomrightNodes.append(n) + * else: + * toprightNodes.append(n) # <<<<<<<<<<<<<< * * if len(topleftNodes) > 0: */ - /*else*/ { - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_bottomrightNodes, ((PyObject *)__pyx_v_n)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 201, __pyx_L1_error) + /*else*/ { + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_toprightNodes, ((PyObject *)__pyx_v_n)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 195, __pyx_L1_error) + } + __pyx_L8:; } - __pyx_L12:; + __pyx_L6:; - /* "fa2/fa2util.py":197 - * toprightNodes = [] - * bottomrightNodes = [] - * for n in rightNodes: # <<<<<<<<<<<<<< - * if n.y < self.massCenterY: - * toprightNodes.append(n) + /* "fa2/fa2util.py":185 + * # subregions now requires only one for loop. Removed + * # topNodes and bottomNodes arrays: memory space saving. + * for n in self.nodes: # <<<<<<<<<<<<<< + * if n.x < self.massCenterX: + * if n.y < self.massCenterY: */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fa2/fa2util.py":203 - * bottomrightNodes.append(n) + /* "fa2/fa2util.py":197 + * toprightNodes.append(n) * * if len(topleftNodes) > 0: # <<<<<<<<<<<<<< * if len(topleftNodes) < len(self.nodes): * subregion = Region(topleftNodes) */ - __pyx_t_5 = PyList_GET_SIZE(__pyx_v_topleftNodes); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 203, __pyx_L1_error) + __pyx_t_5 = PyList_GET_SIZE(__pyx_v_topleftNodes); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 197, __pyx_L1_error) __pyx_t_6 = ((__pyx_t_5 > 0) != 0); if (__pyx_t_6) { - /* "fa2/fa2util.py":204 + /* "fa2/fa2util.py":198 * * if len(topleftNodes) > 0: * if len(topleftNodes) < len(self.nodes): # <<<<<<<<<<<<<< * subregion = Region(topleftNodes) * self.subregions.append(subregion) */ - __pyx_t_5 = PyList_GET_SIZE(__pyx_v_topleftNodes); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_t_5 = PyList_GET_SIZE(__pyx_v_topleftNodes); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 198, __pyx_L1_error) __pyx_t_1 = __pyx_v_self->nodes; __Pyx_INCREF(__pyx_t_1); if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 204, __pyx_L1_error) + __PYX_ERR(2, 198, __pyx_L1_error) } - __pyx_t_8 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_t_8 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(2, 198, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = ((__pyx_t_5 < __pyx_t_8) != 0); if (__pyx_t_6) { - /* "fa2/fa2util.py":205 + /* "fa2/fa2util.py":199 * if len(topleftNodes) > 0: * if len(topleftNodes) < len(self.nodes): * subregion = Region(topleftNodes) # <<<<<<<<<<<<<< * self.subregions.append(subregion) * else: */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_3fa2_7fa2util_Region), __pyx_v_topleftNodes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_3fa2_7fa2util_Region), __pyx_v_topleftNodes); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_subregion = ((struct __pyx_obj_3fa2_7fa2util_Region *)__pyx_t_1); __pyx_t_1 = 0; - /* "fa2/fa2util.py":206 + /* "fa2/fa2util.py":200 * if len(topleftNodes) < len(self.nodes): * subregion = Region(topleftNodes) * self.subregions.append(subregion) # <<<<<<<<<<<<<< @@ -5900,21 +5805,21 @@ static void __pyx_f_3fa2_7fa2util_6Region_buildSubRegions(struct __pyx_obj_3fa2_ */ if (unlikely(__pyx_v_self->subregions == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); - __PYX_ERR(0, 206, __pyx_L1_error) + __PYX_ERR(2, 200, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_self->subregions, ((PyObject *)__pyx_v_subregion)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 206, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_self->subregions, ((PyObject *)__pyx_v_subregion)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 200, __pyx_L1_error) - /* "fa2/fa2util.py":204 + /* "fa2/fa2util.py":198 * * if len(topleftNodes) > 0: * if len(topleftNodes) < len(self.nodes): # <<<<<<<<<<<<<< * subregion = Region(topleftNodes) * self.subregions.append(subregion) */ - goto __pyx_L14; + goto __pyx_L10; } - /* "fa2/fa2util.py":208 + /* "fa2/fa2util.py":202 * self.subregions.append(subregion) * else: * for n in topleftNodes: # <<<<<<<<<<<<<< @@ -5926,34 +5831,34 @@ static void __pyx_f_3fa2_7fa2util_6Region_buildSubRegions(struct __pyx_obj_3fa2_ for (;;) { if (__pyx_t_8 >= 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_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 208, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(2, 202, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 208, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(0, 208, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(2, 202, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_n, ((struct __pyx_obj_3fa2_7fa2util_Node *)__pyx_t_2)); __pyx_t_2 = 0; - /* "fa2/fa2util.py":209 + /* "fa2/fa2util.py":203 * else: * for n in topleftNodes: * subregion = Region([n]) # <<<<<<<<<<<<<< * self.subregions.append(subregion) * */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_n)); __Pyx_GIVEREF(((PyObject *)__pyx_v_n)); PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_n)); - __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_3fa2_7fa2util_Region), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_3fa2_7fa2util_Region), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_subregion, ((struct __pyx_obj_3fa2_7fa2util_Region *)__pyx_t_3)); __pyx_t_3 = 0; - /* "fa2/fa2util.py":210 + /* "fa2/fa2util.py":204 * for n in topleftNodes: * subregion = Region([n]) * self.subregions.append(subregion) # <<<<<<<<<<<<<< @@ -5962,11 +5867,11 @@ static void __pyx_f_3fa2_7fa2util_6Region_buildSubRegions(struct __pyx_obj_3fa2_ */ if (unlikely(__pyx_v_self->subregions == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); - __PYX_ERR(0, 210, __pyx_L1_error) + __PYX_ERR(2, 204, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_self->subregions, ((PyObject *)__pyx_v_subregion)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 210, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_self->subregions, ((PyObject *)__pyx_v_subregion)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 204, __pyx_L1_error) - /* "fa2/fa2util.py":208 + /* "fa2/fa2util.py":202 * self.subregions.append(subregion) * else: * for n in topleftNodes: # <<<<<<<<<<<<<< @@ -5976,10 +5881,10 @@ static void __pyx_f_3fa2_7fa2util_6Region_buildSubRegions(struct __pyx_obj_3fa2_ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_L14:; + __pyx_L10:; - /* "fa2/fa2util.py":203 - * bottomrightNodes.append(n) + /* "fa2/fa2util.py":197 + * toprightNodes.append(n) * * if len(topleftNodes) > 0: # <<<<<<<<<<<<<< * if len(topleftNodes) < len(self.nodes): @@ -5987,49 +5892,49 @@ static void __pyx_f_3fa2_7fa2util_6Region_buildSubRegions(struct __pyx_obj_3fa2_ */ } - /* "fa2/fa2util.py":212 + /* "fa2/fa2util.py":206 * self.subregions.append(subregion) * * if len(bottomleftNodes) > 0: # <<<<<<<<<<<<<< * if len(bottomleftNodes) < len(self.nodes): * subregion = Region(bottomleftNodes) */ - __pyx_t_8 = PyList_GET_SIZE(__pyx_v_bottomleftNodes); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 212, __pyx_L1_error) + __pyx_t_8 = PyList_GET_SIZE(__pyx_v_bottomleftNodes); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(2, 206, __pyx_L1_error) __pyx_t_6 = ((__pyx_t_8 > 0) != 0); if (__pyx_t_6) { - /* "fa2/fa2util.py":213 + /* "fa2/fa2util.py":207 * * if len(bottomleftNodes) > 0: * if len(bottomleftNodes) < len(self.nodes): # <<<<<<<<<<<<<< * subregion = Region(bottomleftNodes) * self.subregions.append(subregion) */ - __pyx_t_8 = PyList_GET_SIZE(__pyx_v_bottomleftNodes); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 213, __pyx_L1_error) + __pyx_t_8 = PyList_GET_SIZE(__pyx_v_bottomleftNodes); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(2, 207, __pyx_L1_error) __pyx_t_1 = __pyx_v_self->nodes; __Pyx_INCREF(__pyx_t_1); if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 213, __pyx_L1_error) + __PYX_ERR(2, 207, __pyx_L1_error) } - __pyx_t_5 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 213, __pyx_L1_error) + __pyx_t_5 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 207, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = ((__pyx_t_8 < __pyx_t_5) != 0); if (__pyx_t_6) { - /* "fa2/fa2util.py":214 + /* "fa2/fa2util.py":208 * if len(bottomleftNodes) > 0: * if len(bottomleftNodes) < len(self.nodes): * subregion = Region(bottomleftNodes) # <<<<<<<<<<<<<< * self.subregions.append(subregion) * else: */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_3fa2_7fa2util_Region), __pyx_v_bottomleftNodes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_3fa2_7fa2util_Region), __pyx_v_bottomleftNodes); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_subregion, ((struct __pyx_obj_3fa2_7fa2util_Region *)__pyx_t_1)); __pyx_t_1 = 0; - /* "fa2/fa2util.py":215 + /* "fa2/fa2util.py":209 * if len(bottomleftNodes) < len(self.nodes): * subregion = Region(bottomleftNodes) * self.subregions.append(subregion) # <<<<<<<<<<<<<< @@ -6038,21 +5943,21 @@ static void __pyx_f_3fa2_7fa2util_6Region_buildSubRegions(struct __pyx_obj_3fa2_ */ if (unlikely(__pyx_v_self->subregions == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); - __PYX_ERR(0, 215, __pyx_L1_error) + __PYX_ERR(2, 209, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_self->subregions, ((PyObject *)__pyx_v_subregion)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 215, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_self->subregions, ((PyObject *)__pyx_v_subregion)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 209, __pyx_L1_error) - /* "fa2/fa2util.py":213 + /* "fa2/fa2util.py":207 * * if len(bottomleftNodes) > 0: * if len(bottomleftNodes) < len(self.nodes): # <<<<<<<<<<<<<< * subregion = Region(bottomleftNodes) * self.subregions.append(subregion) */ - goto __pyx_L18; + goto __pyx_L14; } - /* "fa2/fa2util.py":217 + /* "fa2/fa2util.py":211 * self.subregions.append(subregion) * else: * for n in bottomleftNodes: # <<<<<<<<<<<<<< @@ -6064,34 +5969,34 @@ static void __pyx_f_3fa2_7fa2util_6Region_buildSubRegions(struct __pyx_obj_3fa2_ for (;;) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 217, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 211, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 217, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(0, 217, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(2, 211, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_n, ((struct __pyx_obj_3fa2_7fa2util_Node *)__pyx_t_3)); __pyx_t_3 = 0; - /* "fa2/fa2util.py":218 + /* "fa2/fa2util.py":212 * else: * for n in bottomleftNodes: * subregion = Region([n]) # <<<<<<<<<<<<<< * self.subregions.append(subregion) * */ - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L1_error) + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_n)); __Pyx_GIVEREF(((PyObject *)__pyx_v_n)); PyList_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_n)); - __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_3fa2_7fa2util_Region), __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_3fa2_7fa2util_Region), __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_subregion, ((struct __pyx_obj_3fa2_7fa2util_Region *)__pyx_t_2)); __pyx_t_2 = 0; - /* "fa2/fa2util.py":219 + /* "fa2/fa2util.py":213 * for n in bottomleftNodes: * subregion = Region([n]) * self.subregions.append(subregion) # <<<<<<<<<<<<<< @@ -6100,11 +6005,11 @@ static void __pyx_f_3fa2_7fa2util_6Region_buildSubRegions(struct __pyx_obj_3fa2_ */ if (unlikely(__pyx_v_self->subregions == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); - __PYX_ERR(0, 219, __pyx_L1_error) + __PYX_ERR(2, 213, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_self->subregions, ((PyObject *)__pyx_v_subregion)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 219, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_self->subregions, ((PyObject *)__pyx_v_subregion)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 213, __pyx_L1_error) - /* "fa2/fa2util.py":217 + /* "fa2/fa2util.py":211 * self.subregions.append(subregion) * else: * for n in bottomleftNodes: # <<<<<<<<<<<<<< @@ -6114,9 +6019,9 @@ static void __pyx_f_3fa2_7fa2util_6Region_buildSubRegions(struct __pyx_obj_3fa2_ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_L18:; + __pyx_L14:; - /* "fa2/fa2util.py":212 + /* "fa2/fa2util.py":206 * self.subregions.append(subregion) * * if len(bottomleftNodes) > 0: # <<<<<<<<<<<<<< @@ -6125,49 +6030,49 @@ static void __pyx_f_3fa2_7fa2util_6Region_buildSubRegions(struct __pyx_obj_3fa2_ */ } - /* "fa2/fa2util.py":221 + /* "fa2/fa2util.py":215 * self.subregions.append(subregion) * * if len(toprightNodes) > 0: # <<<<<<<<<<<<<< * if len(toprightNodes) < len(self.nodes): * subregion = Region(toprightNodes) */ - __pyx_t_5 = PyList_GET_SIZE(__pyx_v_toprightNodes); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 221, __pyx_L1_error) + __pyx_t_5 = PyList_GET_SIZE(__pyx_v_toprightNodes); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 215, __pyx_L1_error) __pyx_t_6 = ((__pyx_t_5 > 0) != 0); if (__pyx_t_6) { - /* "fa2/fa2util.py":222 + /* "fa2/fa2util.py":216 * * if len(toprightNodes) > 0: * if len(toprightNodes) < len(self.nodes): # <<<<<<<<<<<<<< * subregion = Region(toprightNodes) * self.subregions.append(subregion) */ - __pyx_t_5 = PyList_GET_SIZE(__pyx_v_toprightNodes); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 222, __pyx_L1_error) + __pyx_t_5 = PyList_GET_SIZE(__pyx_v_toprightNodes); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 216, __pyx_L1_error) __pyx_t_1 = __pyx_v_self->nodes; __Pyx_INCREF(__pyx_t_1); if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 222, __pyx_L1_error) + __PYX_ERR(2, 216, __pyx_L1_error) } - __pyx_t_8 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 222, __pyx_L1_error) + __pyx_t_8 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(2, 216, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = ((__pyx_t_5 < __pyx_t_8) != 0); if (__pyx_t_6) { - /* "fa2/fa2util.py":223 + /* "fa2/fa2util.py":217 * if len(toprightNodes) > 0: * if len(toprightNodes) < len(self.nodes): * subregion = Region(toprightNodes) # <<<<<<<<<<<<<< * self.subregions.append(subregion) * else: */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_3fa2_7fa2util_Region), __pyx_v_toprightNodes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_3fa2_7fa2util_Region), __pyx_v_toprightNodes); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_subregion, ((struct __pyx_obj_3fa2_7fa2util_Region *)__pyx_t_1)); __pyx_t_1 = 0; - /* "fa2/fa2util.py":224 + /* "fa2/fa2util.py":218 * if len(toprightNodes) < len(self.nodes): * subregion = Region(toprightNodes) * self.subregions.append(subregion) # <<<<<<<<<<<<<< @@ -6176,21 +6081,21 @@ static void __pyx_f_3fa2_7fa2util_6Region_buildSubRegions(struct __pyx_obj_3fa2_ */ if (unlikely(__pyx_v_self->subregions == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); - __PYX_ERR(0, 224, __pyx_L1_error) + __PYX_ERR(2, 218, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_self->subregions, ((PyObject *)__pyx_v_subregion)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_self->subregions, ((PyObject *)__pyx_v_subregion)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 218, __pyx_L1_error) - /* "fa2/fa2util.py":222 + /* "fa2/fa2util.py":216 * * if len(toprightNodes) > 0: * if len(toprightNodes) < len(self.nodes): # <<<<<<<<<<<<<< * subregion = Region(toprightNodes) * self.subregions.append(subregion) */ - goto __pyx_L22; + goto __pyx_L18; } - /* "fa2/fa2util.py":226 + /* "fa2/fa2util.py":220 * self.subregions.append(subregion) * else: * for n in toprightNodes: # <<<<<<<<<<<<<< @@ -6202,34 +6107,34 @@ static void __pyx_f_3fa2_7fa2util_6Region_buildSubRegions(struct __pyx_obj_3fa2_ for (;;) { if (__pyx_t_8 >= 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_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(2, 220, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(0, 226, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(2, 220, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_n, ((struct __pyx_obj_3fa2_7fa2util_Node *)__pyx_t_2)); __pyx_t_2 = 0; - /* "fa2/fa2util.py":227 + /* "fa2/fa2util.py":221 * else: * for n in toprightNodes: * subregion = Region([n]) # <<<<<<<<<<<<<< * self.subregions.append(subregion) * */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error) + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_n)); __Pyx_GIVEREF(((PyObject *)__pyx_v_n)); PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_n)); - __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_3fa2_7fa2util_Region), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 227, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_3fa2_7fa2util_Region), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_subregion, ((struct __pyx_obj_3fa2_7fa2util_Region *)__pyx_t_3)); __pyx_t_3 = 0; - /* "fa2/fa2util.py":228 + /* "fa2/fa2util.py":222 * for n in toprightNodes: * subregion = Region([n]) * self.subregions.append(subregion) # <<<<<<<<<<<<<< @@ -6238,11 +6143,11 @@ static void __pyx_f_3fa2_7fa2util_6Region_buildSubRegions(struct __pyx_obj_3fa2_ */ if (unlikely(__pyx_v_self->subregions == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); - __PYX_ERR(0, 228, __pyx_L1_error) + __PYX_ERR(2, 222, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_self->subregions, ((PyObject *)__pyx_v_subregion)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 228, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_self->subregions, ((PyObject *)__pyx_v_subregion)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 222, __pyx_L1_error) - /* "fa2/fa2util.py":226 + /* "fa2/fa2util.py":220 * self.subregions.append(subregion) * else: * for n in toprightNodes: # <<<<<<<<<<<<<< @@ -6252,9 +6157,9 @@ static void __pyx_f_3fa2_7fa2util_6Region_buildSubRegions(struct __pyx_obj_3fa2_ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_L22:; + __pyx_L18:; - /* "fa2/fa2util.py":221 + /* "fa2/fa2util.py":215 * self.subregions.append(subregion) * * if len(toprightNodes) > 0: # <<<<<<<<<<<<<< @@ -6263,49 +6168,49 @@ static void __pyx_f_3fa2_7fa2util_6Region_buildSubRegions(struct __pyx_obj_3fa2_ */ } - /* "fa2/fa2util.py":230 + /* "fa2/fa2util.py":224 * self.subregions.append(subregion) * * if len(bottomrightNodes) > 0: # <<<<<<<<<<<<<< * if len(bottomrightNodes) < len(self.nodes): * subregion = Region(bottomrightNodes) */ - __pyx_t_8 = PyList_GET_SIZE(__pyx_v_bottomrightNodes); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 230, __pyx_L1_error) + __pyx_t_8 = PyList_GET_SIZE(__pyx_v_bottomrightNodes); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(2, 224, __pyx_L1_error) __pyx_t_6 = ((__pyx_t_8 > 0) != 0); if (__pyx_t_6) { - /* "fa2/fa2util.py":231 + /* "fa2/fa2util.py":225 * * if len(bottomrightNodes) > 0: * if len(bottomrightNodes) < len(self.nodes): # <<<<<<<<<<<<<< * subregion = Region(bottomrightNodes) * self.subregions.append(subregion) */ - __pyx_t_8 = PyList_GET_SIZE(__pyx_v_bottomrightNodes); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_8 = PyList_GET_SIZE(__pyx_v_bottomrightNodes); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(2, 225, __pyx_L1_error) __pyx_t_1 = __pyx_v_self->nodes; __Pyx_INCREF(__pyx_t_1); if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 231, __pyx_L1_error) + __PYX_ERR(2, 225, __pyx_L1_error) } - __pyx_t_5 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_5 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 225, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = ((__pyx_t_8 < __pyx_t_5) != 0); if (__pyx_t_6) { - /* "fa2/fa2util.py":232 + /* "fa2/fa2util.py":226 * if len(bottomrightNodes) > 0: * if len(bottomrightNodes) < len(self.nodes): * subregion = Region(bottomrightNodes) # <<<<<<<<<<<<<< * self.subregions.append(subregion) * else: */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_3fa2_7fa2util_Region), __pyx_v_bottomrightNodes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_3fa2_7fa2util_Region), __pyx_v_bottomrightNodes); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_subregion, ((struct __pyx_obj_3fa2_7fa2util_Region *)__pyx_t_1)); __pyx_t_1 = 0; - /* "fa2/fa2util.py":233 + /* "fa2/fa2util.py":227 * if len(bottomrightNodes) < len(self.nodes): * subregion = Region(bottomrightNodes) * self.subregions.append(subregion) # <<<<<<<<<<<<<< @@ -6314,21 +6219,21 @@ static void __pyx_f_3fa2_7fa2util_6Region_buildSubRegions(struct __pyx_obj_3fa2_ */ if (unlikely(__pyx_v_self->subregions == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); - __PYX_ERR(0, 233, __pyx_L1_error) + __PYX_ERR(2, 227, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_self->subregions, ((PyObject *)__pyx_v_subregion)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_self->subregions, ((PyObject *)__pyx_v_subregion)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 227, __pyx_L1_error) - /* "fa2/fa2util.py":231 + /* "fa2/fa2util.py":225 * * if len(bottomrightNodes) > 0: * if len(bottomrightNodes) < len(self.nodes): # <<<<<<<<<<<<<< * subregion = Region(bottomrightNodes) * self.subregions.append(subregion) */ - goto __pyx_L26; + goto __pyx_L22; } - /* "fa2/fa2util.py":235 + /* "fa2/fa2util.py":229 * self.subregions.append(subregion) * else: * for n in bottomrightNodes: # <<<<<<<<<<<<<< @@ -6340,34 +6245,34 @@ static void __pyx_f_3fa2_7fa2util_6Region_buildSubRegions(struct __pyx_obj_3fa2_ for (;;) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 229, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(0, 235, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(2, 229, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_n, ((struct __pyx_obj_3fa2_7fa2util_Node *)__pyx_t_3)); __pyx_t_3 = 0; - /* "fa2/fa2util.py":236 + /* "fa2/fa2util.py":230 * else: * for n in bottomrightNodes: * subregion = Region([n]) # <<<<<<<<<<<<<< * self.subregions.append(subregion) * */ - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_n)); __Pyx_GIVEREF(((PyObject *)__pyx_v_n)); PyList_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_n)); - __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_3fa2_7fa2util_Region), __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_3fa2_7fa2util_Region), __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_subregion, ((struct __pyx_obj_3fa2_7fa2util_Region *)__pyx_t_2)); __pyx_t_2 = 0; - /* "fa2/fa2util.py":237 + /* "fa2/fa2util.py":231 * for n in bottomrightNodes: * subregion = Region([n]) * self.subregions.append(subregion) # <<<<<<<<<<<<<< @@ -6376,11 +6281,11 @@ static void __pyx_f_3fa2_7fa2util_6Region_buildSubRegions(struct __pyx_obj_3fa2_ */ if (unlikely(__pyx_v_self->subregions == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); - __PYX_ERR(0, 237, __pyx_L1_error) + __PYX_ERR(2, 231, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_self->subregions, ((PyObject *)__pyx_v_subregion)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_self->subregions, ((PyObject *)__pyx_v_subregion)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 231, __pyx_L1_error) - /* "fa2/fa2util.py":235 + /* "fa2/fa2util.py":229 * self.subregions.append(subregion) * else: * for n in bottomrightNodes: # <<<<<<<<<<<<<< @@ -6390,9 +6295,9 @@ static void __pyx_f_3fa2_7fa2util_6Region_buildSubRegions(struct __pyx_obj_3fa2_ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_L26:; + __pyx_L22:; - /* "fa2/fa2util.py":230 + /* "fa2/fa2util.py":224 * self.subregions.append(subregion) * * if len(bottomrightNodes) > 0: # <<<<<<<<<<<<<< @@ -6401,7 +6306,7 @@ static void __pyx_f_3fa2_7fa2util_6Region_buildSubRegions(struct __pyx_obj_3fa2_ */ } - /* "fa2/fa2util.py":239 + /* "fa2/fa2util.py":233 * self.subregions.append(subregion) * * for subregion in self.subregions: # <<<<<<<<<<<<<< @@ -6410,22 +6315,22 @@ static void __pyx_f_3fa2_7fa2util_6Region_buildSubRegions(struct __pyx_obj_3fa2_ */ if (unlikely(__pyx_v_self->subregions == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 239, __pyx_L1_error) + __PYX_ERR(2, 233, __pyx_L1_error) } __pyx_t_1 = __pyx_v_self->subregions; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; for (;;) { 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, 239, __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(2, 233, __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, 239, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_3fa2_7fa2util_Region))))) __PYX_ERR(0, 239, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_3fa2_7fa2util_Region))))) __PYX_ERR(2, 233, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_subregion, ((struct __pyx_obj_3fa2_7fa2util_Region *)__pyx_t_2)); __pyx_t_2 = 0; - /* "fa2/fa2util.py":240 + /* "fa2/fa2util.py":234 * * for subregion in self.subregions: * subregion.buildSubRegions() # <<<<<<<<<<<<<< @@ -6434,7 +6339,7 @@ static void __pyx_f_3fa2_7fa2util_6Region_buildSubRegions(struct __pyx_obj_3fa2_ */ ((struct __pyx_vtabstruct_3fa2_7fa2util_Region *)__pyx_v_subregion->__pyx_vtab)->buildSubRegions(__pyx_v_subregion, 0); - /* "fa2/fa2util.py":239 + /* "fa2/fa2util.py":233 * self.subregions.append(subregion) * * for subregion in self.subregions: # <<<<<<<<<<<<<< @@ -6448,8 +6353,8 @@ static void __pyx_f_3fa2_7fa2util_6Region_buildSubRegions(struct __pyx_obj_3fa2_ * * def buildSubRegions(self): * if len(self.nodes) > 1: # <<<<<<<<<<<<<< - * - * leftNodes = [] + * topleftNodes = [] + * bottomleftNodes = [] */ } @@ -6458,7 +6363,7 @@ static void __pyx_f_3fa2_7fa2util_6Region_buildSubRegions(struct __pyx_obj_3fa2_ * * def buildSubRegions(self): # <<<<<<<<<<<<<< * if len(self.nodes) > 1: - * + * topleftNodes = [] */ /* function exit code */ @@ -6471,8 +6376,6 @@ static void __pyx_f_3fa2_7fa2util_6Region_buildSubRegions(struct __pyx_obj_3fa2_ __Pyx_WriteUnraisable("fa2.fa2util.Region.buildSubRegions", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_n); - __Pyx_XDECREF(__pyx_v_leftNodes); - __Pyx_XDECREF(__pyx_v_rightNodes); __Pyx_XDECREF(__pyx_v_topleftNodes); __Pyx_XDECREF(__pyx_v_bottomleftNodes); __Pyx_XDECREF(__pyx_v_toprightNodes); @@ -6501,7 +6404,7 @@ static PyObject *__pyx_pf_3fa2_7fa2util_6Region_2buildSubRegions(struct __pyx_ob PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("buildSubRegions", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_void_to_None(__pyx_f_3fa2_7fa2util_6Region_buildSubRegions(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error) + __pyx_t_1 = __Pyx_void_to_None(__pyx_f_3fa2_7fa2util_6Region_buildSubRegions(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -6518,7 +6421,7 @@ static PyObject *__pyx_pf_3fa2_7fa2util_6Region_2buildSubRegions(struct __pyx_ob return __pyx_r; } -/* "fa2/fa2util.py":242 +/* "fa2/fa2util.py":236 * subregion.buildSubRegions() * * def applyForce(self, n, theta, coefficient=0): # <<<<<<<<<<<<<< @@ -6548,7 +6451,7 @@ static void __pyx_f_3fa2_7fa2util_6Region_applyForce(struct __pyx_obj_3fa2_7fa2u } } - /* "fa2/fa2util.py":243 + /* "fa2/fa2util.py":237 * * def applyForce(self, n, theta, coefficient=0): * if len(self.nodes) < 2: # <<<<<<<<<<<<<< @@ -6559,14 +6462,14 @@ static void __pyx_f_3fa2_7fa2util_6Region_applyForce(struct __pyx_obj_3fa2_7fa2u __Pyx_INCREF(__pyx_t_1); if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 243, __pyx_L1_error) + __PYX_ERR(2, 237, __pyx_L1_error) } - __pyx_t_2 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 243, __pyx_L1_error) + __pyx_t_2 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(2, 237, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((__pyx_t_2 < 2) != 0); if (__pyx_t_3) { - /* "fa2/fa2util.py":244 + /* "fa2/fa2util.py":238 * def applyForce(self, n, theta, coefficient=0): * if len(self.nodes) < 2: * linRepulsion(n, self.nodes[0], coefficient) # <<<<<<<<<<<<<< @@ -6575,17 +6478,17 @@ static void __pyx_f_3fa2_7fa2util_6Region_applyForce(struct __pyx_obj_3fa2_7fa2u */ if (unlikely(__pyx_v_self->nodes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 244, __pyx_L1_error) + __PYX_ERR(2, 238, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_self->nodes, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 244, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_self->nodes, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(0, 244, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(2, 238, __pyx_L1_error) __pyx_t_4.__pyx_n = 1; __pyx_t_4.coefficient = __pyx_v_coefficient; __pyx_f_3fa2_7fa2util_linRepulsion(__pyx_v_n, ((struct __pyx_obj_3fa2_7fa2util_Node *)__pyx_t_1), &__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fa2/fa2util.py":243 + /* "fa2/fa2util.py":237 * * def applyForce(self, n, theta, coefficient=0): * if len(self.nodes) < 2: # <<<<<<<<<<<<<< @@ -6595,7 +6498,7 @@ static void __pyx_f_3fa2_7fa2util_6Region_applyForce(struct __pyx_obj_3fa2_7fa2u goto __pyx_L3; } - /* "fa2/fa2util.py":246 + /* "fa2/fa2util.py":240 * linRepulsion(n, self.nodes[0], coefficient) * else: * distance = sqrt((n.x - self.massCenterX) ** 2 + (n.y - self.massCenterY) ** 2) # <<<<<<<<<<<<<< @@ -6603,9 +6506,9 @@ static void __pyx_f_3fa2_7fa2util_6Region_applyForce(struct __pyx_obj_3fa2_7fa2u * linRepulsion_region(n, self, coefficient) */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 246, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyFloat_FromDouble((pow((__pyx_v_n->x - __pyx_v_self->massCenterX), 2.0) + pow((__pyx_v_n->y - __pyx_v_self->massCenterY), 2.0))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_6 = PyFloat_FromDouble((pow((__pyx_v_n->x - __pyx_v_self->massCenterX), 2.0) + pow((__pyx_v_n->y - __pyx_v_self->massCenterY), 2.0))); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -6620,14 +6523,14 @@ static void __pyx_f_3fa2_7fa2util_6Region_applyForce(struct __pyx_obj_3fa2_7fa2u __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 240, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_distance = __pyx_t_8; - /* "fa2/fa2util.py":247 + /* "fa2/fa2util.py":241 * else: * distance = sqrt((n.x - self.massCenterX) ** 2 + (n.y - self.massCenterY) ** 2) * if distance * theta > self.size: # <<<<<<<<<<<<<< @@ -6637,7 +6540,7 @@ static void __pyx_f_3fa2_7fa2util_6Region_applyForce(struct __pyx_obj_3fa2_7fa2u __pyx_t_3 = (((__pyx_v_distance * __pyx_v_theta) > __pyx_v_self->size) != 0); if (__pyx_t_3) { - /* "fa2/fa2util.py":248 + /* "fa2/fa2util.py":242 * distance = sqrt((n.x - self.massCenterX) ** 2 + (n.y - self.massCenterY) ** 2) * if distance * theta > self.size: * linRepulsion_region(n, self, coefficient) # <<<<<<<<<<<<<< @@ -6648,7 +6551,7 @@ static void __pyx_f_3fa2_7fa2util_6Region_applyForce(struct __pyx_obj_3fa2_7fa2u __pyx_t_9.coefficient = __pyx_v_coefficient; __pyx_f_3fa2_7fa2util_linRepulsion_region(__pyx_v_n, __pyx_v_self, &__pyx_t_9); - /* "fa2/fa2util.py":247 + /* "fa2/fa2util.py":241 * else: * distance = sqrt((n.x - self.massCenterX) ** 2 + (n.y - self.massCenterY) ** 2) * if distance * theta > self.size: # <<<<<<<<<<<<<< @@ -6658,7 +6561,7 @@ static void __pyx_f_3fa2_7fa2util_6Region_applyForce(struct __pyx_obj_3fa2_7fa2u goto __pyx_L4; } - /* "fa2/fa2util.py":250 + /* "fa2/fa2util.py":244 * linRepulsion_region(n, self, coefficient) * else: * for subregion in self.subregions: # <<<<<<<<<<<<<< @@ -6668,22 +6571,22 @@ static void __pyx_f_3fa2_7fa2util_6Region_applyForce(struct __pyx_obj_3fa2_7fa2u /*else*/ { if (unlikely(__pyx_v_self->subregions == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 250, __pyx_L1_error) + __PYX_ERR(2, 244, __pyx_L1_error) } __pyx_t_1 = __pyx_v_self->subregions; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(2, 244, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_3fa2_7fa2util_Region))))) __PYX_ERR(0, 250, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_3fa2_7fa2util_Region))))) __PYX_ERR(2, 244, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_subregion, ((struct __pyx_obj_3fa2_7fa2util_Region *)__pyx_t_5)); __pyx_t_5 = 0; - /* "fa2/fa2util.py":251 + /* "fa2/fa2util.py":245 * else: * for subregion in self.subregions: * subregion.applyForce(n, theta, coefficient) # <<<<<<<<<<<<<< @@ -6694,7 +6597,7 @@ static void __pyx_f_3fa2_7fa2util_6Region_applyForce(struct __pyx_obj_3fa2_7fa2u __pyx_t_10.coefficient = __pyx_v_coefficient; ((struct __pyx_vtabstruct_3fa2_7fa2util_Region *)__pyx_v_subregion->__pyx_vtab)->applyForce(__pyx_v_subregion, __pyx_v_n, __pyx_v_theta, &__pyx_t_10); - /* "fa2/fa2util.py":250 + /* "fa2/fa2util.py":244 * linRepulsion_region(n, self, coefficient) * else: * for subregion in self.subregions: # <<<<<<<<<<<<<< @@ -6708,7 +6611,7 @@ static void __pyx_f_3fa2_7fa2util_6Region_applyForce(struct __pyx_obj_3fa2_7fa2u } __pyx_L3:; - /* "fa2/fa2util.py":242 + /* "fa2/fa2util.py":236 * subregion.buildSubRegions() * * def applyForce(self, n, theta, coefficient=0): # <<<<<<<<<<<<<< @@ -6729,7 +6632,7 @@ static void __pyx_f_3fa2_7fa2util_6Region_applyForce(struct __pyx_obj_3fa2_7fa2u __Pyx_RefNannyFinishContext(); } -/* "fa2/fa2util.py":253 +/* "fa2/fa2util.py":247 * subregion.applyForce(n, theta, coefficient) * * def applyForceOnNodes(self, nodes, theta, coefficient=0): # <<<<<<<<<<<<<< @@ -6768,13 +6671,13 @@ static PyObject *__pyx_f_3fa2_7fa2util_6Region_applyForceOnNodes(struct __pyx_ob if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_applyForceOnNodes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_applyForceOnNodes); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_3fa2_7fa2util_6Region_5applyForceOnNodes)) { __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_theta); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_theta); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyFloat_FromDouble(__pyx_v_coefficient); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_t_4 = PyFloat_FromDouble(__pyx_v_coefficient); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = __pyx_t_1; __pyx_t_6 = NULL; @@ -6792,7 +6695,7 @@ static PyObject *__pyx_f_3fa2_7fa2util_6Region_applyForceOnNodes(struct __pyx_ob #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_v_nodes, __pyx_t_3, __pyx_t_4}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 247, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -6802,7 +6705,7 @@ static PyObject *__pyx_f_3fa2_7fa2util_6Region_applyForceOnNodes(struct __pyx_ob #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_v_nodes, __pyx_t_3, __pyx_t_4}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 247, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -6810,7 +6713,7 @@ static PyObject *__pyx_f_3fa2_7fa2util_6Region_applyForceOnNodes(struct __pyx_ob } else #endif { - __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; @@ -6824,7 +6727,7 @@ static PyObject *__pyx_f_3fa2_7fa2util_6Region_applyForceOnNodes(struct __pyx_ob PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } @@ -6847,7 +6750,7 @@ static PyObject *__pyx_f_3fa2_7fa2util_6Region_applyForceOnNodes(struct __pyx_ob #endif } - /* "fa2/fa2util.py":254 + /* "fa2/fa2util.py":248 * * def applyForceOnNodes(self, nodes, theta, coefficient=0): * for n in nodes: # <<<<<<<<<<<<<< @@ -6856,22 +6759,22 @@ static PyObject *__pyx_f_3fa2_7fa2util_6Region_applyForceOnNodes(struct __pyx_ob */ if (unlikely(__pyx_v_nodes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 254, __pyx_L1_error) + __PYX_ERR(2, 248, __pyx_L1_error) } __pyx_t_1 = __pyx_v_nodes; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0; for (;;) { if (__pyx_t_9 >= 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_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 254, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(2, 248, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 254, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(0, 254, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(2, 248, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_n, ((struct __pyx_obj_3fa2_7fa2util_Node *)__pyx_t_2)); __pyx_t_2 = 0; - /* "fa2/fa2util.py":255 + /* "fa2/fa2util.py":249 * def applyForceOnNodes(self, nodes, theta, coefficient=0): * for n in nodes: * self.applyForce(n, theta, coefficient) # <<<<<<<<<<<<<< @@ -6882,7 +6785,7 @@ static PyObject *__pyx_f_3fa2_7fa2util_6Region_applyForceOnNodes(struct __pyx_ob __pyx_t_10.coefficient = __pyx_v_coefficient; ((struct __pyx_vtabstruct_3fa2_7fa2util_Region *)__pyx_v_self->__pyx_vtab)->applyForce(__pyx_v_self, __pyx_v_n, __pyx_v_theta, &__pyx_t_10); - /* "fa2/fa2util.py":254 + /* "fa2/fa2util.py":248 * * def applyForceOnNodes(self, nodes, theta, coefficient=0): * for n in nodes: # <<<<<<<<<<<<<< @@ -6892,7 +6795,7 @@ static PyObject *__pyx_f_3fa2_7fa2util_6Region_applyForceOnNodes(struct __pyx_ob } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fa2/fa2util.py":253 + /* "fa2/fa2util.py":247 * subregion.applyForce(n, theta, coefficient) * * def applyForceOnNodes(self, nodes, theta, coefficient=0): # <<<<<<<<<<<<<< @@ -6955,7 +6858,7 @@ static PyObject *__pyx_pw_3fa2_7fa2util_6Region_5applyForceOnNodes(PyObject *__p case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_theta)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("applyForceOnNodes", 0, 2, 3, 1); __PYX_ERR(0, 253, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("applyForceOnNodes", 0, 2, 3, 1); __PYX_ERR(2, 247, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -6965,7 +6868,7 @@ static PyObject *__pyx_pw_3fa2_7fa2util_6Region_5applyForceOnNodes(PyObject *__p } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "applyForceOnNodes") < 0)) __PYX_ERR(0, 253, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "applyForceOnNodes") < 0)) __PYX_ERR(2, 247, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -6978,22 +6881,22 @@ static PyObject *__pyx_pw_3fa2_7fa2util_6Region_5applyForceOnNodes(PyObject *__p } } __pyx_v_nodes = ((PyObject*)values[0]); - __pyx_v_theta = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_theta == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 253, __pyx_L3_error) + __pyx_v_theta = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_theta == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 247, __pyx_L3_error) if (values[2]) { - __pyx_v_coefficient = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_coefficient == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 253, __pyx_L3_error) + __pyx_v_coefficient = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_coefficient == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 247, __pyx_L3_error) } else { __pyx_v_coefficient = ((double)0.0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("applyForceOnNodes", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 253, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("applyForceOnNodes", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 247, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fa2.fa2util.Region.applyForceOnNodes", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodes), (&PyList_Type), 1, "nodes", 1))) __PYX_ERR(0, 253, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodes), (&PyList_Type), 1, "nodes", 1))) __PYX_ERR(2, 247, __pyx_L1_error) __pyx_r = __pyx_pf_3fa2_7fa2util_6Region_4applyForceOnNodes(((struct __pyx_obj_3fa2_7fa2util_Region *)__pyx_v_self), __pyx_v_nodes, __pyx_v_theta, __pyx_v_coefficient); /* function exit code */ @@ -7014,7 +6917,7 @@ static PyObject *__pyx_pf_3fa2_7fa2util_6Region_4applyForceOnNodes(struct __pyx_ __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 1; __pyx_t_2.coefficient = __pyx_v_coefficient; - __pyx_t_1 = __pyx_vtabptr_3fa2_7fa2util_Region->applyForceOnNodes(__pyx_v_self, __pyx_v_nodes, __pyx_v_theta, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_t_1 = __pyx_vtabptr_3fa2_7fa2util_Region->applyForceOnNodes(__pyx_v_self, __pyx_v_nodes, __pyx_v_theta, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -7058,7 +6961,7 @@ static PyObject *__pyx_pf_3fa2_7fa2util_6Region_4mass___get__(struct __pyx_obj_3 PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->mass); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 77, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->mass); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -7093,7 +6996,7 @@ static int __pyx_pf_3fa2_7fa2util_6Region_4mass_2__set__(struct __pyx_obj_3fa2_7 __Pyx_RefNannyDeclarations double __pyx_t_1; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 77, __pyx_L1_error) + __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 77, __pyx_L1_error) __pyx_v_self->mass = __pyx_t_1; /* function exit code */ @@ -7134,7 +7037,7 @@ static PyObject *__pyx_pf_3fa2_7fa2util_6Region_11massCenterX___get__(struct __p PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->massCenterX); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 78, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->massCenterX); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -7169,7 +7072,7 @@ static int __pyx_pf_3fa2_7fa2util_6Region_11massCenterX_2__set__(struct __pyx_ob __Pyx_RefNannyDeclarations double __pyx_t_1; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 78, __pyx_L1_error) + __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L1_error) __pyx_v_self->massCenterX = __pyx_t_1; /* function exit code */ @@ -7202,7 +7105,7 @@ static PyObject *__pyx_pf_3fa2_7fa2util_6Region_11massCenterY___get__(struct __p PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->massCenterY); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 78, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->massCenterY); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -7237,7 +7140,7 @@ static int __pyx_pf_3fa2_7fa2util_6Region_11massCenterY_2__set__(struct __pyx_ob __Pyx_RefNannyDeclarations double __pyx_t_1; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 78, __pyx_L1_error) + __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L1_error) __pyx_v_self->massCenterY = __pyx_t_1; /* function exit code */ @@ -7278,7 +7181,7 @@ static PyObject *__pyx_pf_3fa2_7fa2util_6Region_4size___get__(struct __pyx_obj_3 PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 79, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -7313,7 +7216,7 @@ static int __pyx_pf_3fa2_7fa2util_6Region_4size_2__set__(struct __pyx_obj_3fa2_7 __Pyx_RefNannyDeclarations double __pyx_t_1; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 79, __pyx_L1_error) + __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L1_error) __pyx_v_self->size = __pyx_t_1; /* function exit code */ @@ -7382,7 +7285,7 @@ static int __pyx_pf_3fa2_7fa2util_6Region_5nodes_2__set__(struct __pyx_obj_3fa2_ __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__set__", 0); - if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(1, 80, __pyx_L1_error) + if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 80, __pyx_L1_error) __pyx_t_1 = __pyx_v_value; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -7487,7 +7390,7 @@ static int __pyx_pf_3fa2_7fa2util_6Region_10subregions_2__set__(struct __pyx_obj __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__set__", 0); - if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(1, 81, __pyx_L1_error) + if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 81, __pyx_L1_error) __pyx_t_1 = __pyx_v_value; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -7580,15 +7483,15 @@ static PyObject *__pyx_pf_3fa2_7fa2util_6Region_6__reduce_cython__(struct __pyx_ * _dict = getattr(self, '__dict__', None) * if _dict is not None: */ - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->mass); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->mass); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->massCenterX); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->massCenterX); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->massCenterY); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->massCenterY); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->size); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error) + __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->size); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(6); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 5, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(6); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); @@ -7618,7 +7521,7 @@ static PyObject *__pyx_pf_3fa2_7fa2util_6Region_6__reduce_cython__(struct __pyx_ * if _dict is not None: * state += (_dict,) */ - __pyx_t_5 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 6, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v__dict = __pyx_t_5; __pyx_t_5 = 0; @@ -7641,12 +7544,12 @@ static PyObject *__pyx_pf_3fa2_7fa2util_6Region_6__reduce_cython__(struct __pyx_ * use_setstate = True * else: */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 8, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v__dict); __Pyx_GIVEREF(__pyx_v__dict); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v__dict); - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 8, __pyx_L1_error) + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4)); @@ -7712,9 +7615,9 @@ static PyObject *__pyx_pf_3fa2_7fa2util_6Region_6__reduce_cython__(struct __pyx_ * return __pyx_unpickle_Region, (type(self), 0x66ef4c7, state) */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Region); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Region); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 13, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); @@ -7725,7 +7628,7 @@ static PyObject *__pyx_pf_3fa2_7fa2util_6Region_6__reduce_cython__(struct __pyx_ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_5, 2, Py_None); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 13, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); @@ -7758,9 +7661,9 @@ static PyObject *__pyx_pf_3fa2_7fa2util_6Region_6__reduce_cython__(struct __pyx_ */ /*else*/ { __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_Region); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 15, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_Region); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 15, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); @@ -7771,7 +7674,7 @@ static PyObject *__pyx_pf_3fa2_7fa2util_6Region_6__reduce_cython__(struct __pyx_ __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 15, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); @@ -7839,8 +7742,8 @@ static PyObject *__pyx_pf_3fa2_7fa2util_6Region_8__setstate_cython__(struct __py * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_Region__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ - if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 17, __pyx_L1_error) - __pyx_t_1 = __pyx_f_3fa2_7fa2util___pyx_unpickle_Region__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error) + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error) + __pyx_t_1 = __pyx_f_3fa2_7fa2util___pyx_unpickle_Region__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -7864,7 +7767,7 @@ static PyObject *__pyx_pf_3fa2_7fa2util_6Region_8__setstate_cython__(struct __py return __pyx_r; } -/* "fa2/fa2util.py":259 +/* "fa2/fa2util.py":253 * * # Adjust speed and apply forces step * def adjustSpeedAndApplyForces(nodes, speed, speedEfficiency, jitterTolerance): # <<<<<<<<<<<<<< @@ -7903,9 +7806,10 @@ static PyObject *__pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces(PyObject *__pyx double __pyx_t_12; double __pyx_t_13; int __pyx_t_14; + int __pyx_t_15; __Pyx_RefNannySetupContext("adjustSpeedAndApplyForces", 0); - /* "fa2/fa2util.py":261 + /* "fa2/fa2util.py":255 * def adjustSpeedAndApplyForces(nodes, speed, speedEfficiency, jitterTolerance): * # Auto adjust speed. * totalSwinging = 0.0 # How much irregular movement # <<<<<<<<<<<<<< @@ -7914,7 +7818,7 @@ static PyObject *__pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces(PyObject *__pyx */ __pyx_v_totalSwinging = 0.0; - /* "fa2/fa2util.py":262 + /* "fa2/fa2util.py":256 * # Auto adjust speed. * totalSwinging = 0.0 # How much irregular movement * totalEffectiveTraction = 0.0 # How much useful movement # <<<<<<<<<<<<<< @@ -7923,7 +7827,7 @@ static PyObject *__pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces(PyObject *__pyx */ __pyx_v_totalEffectiveTraction = 0.0; - /* "fa2/fa2util.py":263 + /* "fa2/fa2util.py":257 * totalSwinging = 0.0 # How much irregular movement * totalEffectiveTraction = 0.0 # How much useful movement * for n in nodes: # <<<<<<<<<<<<<< @@ -7932,31 +7836,31 @@ static PyObject *__pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces(PyObject *__pyx */ if (unlikely(__pyx_v_nodes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 263, __pyx_L1_error) + __PYX_ERR(2, 257, __pyx_L1_error) } __pyx_t_1 = __pyx_v_nodes; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 263, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(2, 257, __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(0, 263, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(0, 263, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(2, 257, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_n, ((struct __pyx_obj_3fa2_7fa2util_Node *)__pyx_t_3)); __pyx_t_3 = 0; - /* "fa2/fa2util.py":264 + /* "fa2/fa2util.py":258 * totalEffectiveTraction = 0.0 # How much useful movement * for n in nodes: * swinging = sqrt((n.old_dx - n.dx) * (n.old_dx - n.dx) + (n.old_dy - n.dy) * (n.old_dy - n.dy)) # <<<<<<<<<<<<<< * totalSwinging += n.mass * swinging * totalEffectiveTraction += .5 * n.mass * sqrt( */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 264, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyFloat_FromDouble((((__pyx_v_n->old_dx - __pyx_v_n->dx) * (__pyx_v_n->old_dx - __pyx_v_n->dx)) + ((__pyx_v_n->old_dy - __pyx_v_n->dy) * (__pyx_v_n->old_dy - __pyx_v_n->dy)))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 264, __pyx_L1_error) + __pyx_t_5 = PyFloat_FromDouble((((__pyx_v_n->old_dx - __pyx_v_n->dx) * (__pyx_v_n->old_dx - __pyx_v_n->dx)) + ((__pyx_v_n->old_dy - __pyx_v_n->dy) * (__pyx_v_n->old_dy - __pyx_v_n->dy)))); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -7971,14 +7875,14 @@ static PyObject *__pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces(PyObject *__pyx __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 264, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 264, __pyx_L1_error) + __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 258, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_swinging = __pyx_t_7; - /* "fa2/fa2util.py":265 + /* "fa2/fa2util.py":259 * for n in nodes: * swinging = sqrt((n.old_dx - n.dx) * (n.old_dx - n.dx) + (n.old_dy - n.dy) * (n.old_dy - n.dy)) * totalSwinging += n.mass * swinging # <<<<<<<<<<<<<< @@ -7987,28 +7891,28 @@ static PyObject *__pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces(PyObject *__pyx */ __pyx_v_totalSwinging = (__pyx_v_totalSwinging + (__pyx_v_n->mass * __pyx_v_swinging)); - /* "fa2/fa2util.py":266 + /* "fa2/fa2util.py":260 * swinging = sqrt((n.old_dx - n.dx) * (n.old_dx - n.dx) + (n.old_dy - n.dy) * (n.old_dy - n.dy)) * totalSwinging += n.mass * swinging * totalEffectiveTraction += .5 * n.mass * sqrt( # <<<<<<<<<<<<<< * (n.old_dx + n.dx) * (n.old_dx + n.dx) + (n.old_dy + n.dy) * (n.old_dy + n.dy)) * */ - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_totalEffectiveTraction); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_totalEffectiveTraction); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyFloat_FromDouble((.5 * __pyx_v_n->mass)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_t_4 = PyFloat_FromDouble((.5 * __pyx_v_n->mass)); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - /* "fa2/fa2util.py":267 + /* "fa2/fa2util.py":261 * totalSwinging += n.mass * swinging * totalEffectiveTraction += .5 * n.mass * sqrt( * (n.old_dx + n.dx) * (n.old_dx + n.dx) + (n.old_dy + n.dy) * (n.old_dy + n.dy)) # <<<<<<<<<<<<<< * * # Optimize jitter tolerance. The 'right' jitter tolerance for */ - __pyx_t_8 = PyFloat_FromDouble((((__pyx_v_n->old_dx + __pyx_v_n->dx) * (__pyx_v_n->old_dx + __pyx_v_n->dx)) + ((__pyx_v_n->old_dy + __pyx_v_n->dy) * (__pyx_v_n->old_dy + __pyx_v_n->dy)))); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 267, __pyx_L1_error) + __pyx_t_8 = PyFloat_FromDouble((((__pyx_v_n->old_dx + __pyx_v_n->dx) * (__pyx_v_n->old_dx + __pyx_v_n->dx)) + ((__pyx_v_n->old_dy + __pyx_v_n->dy) * (__pyx_v_n->old_dy + __pyx_v_n->dy)))); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { @@ -8023,30 +7927,30 @@ static PyObject *__pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces(PyObject *__pyx __pyx_t_5 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_9, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 266, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "fa2/fa2util.py":266 + /* "fa2/fa2util.py":260 * swinging = sqrt((n.old_dx - n.dx) * (n.old_dx - n.dx) + (n.old_dy - n.dy) * (n.old_dy - n.dy)) * totalSwinging += n.mass * swinging * totalEffectiveTraction += .5 * n.mass * sqrt( # <<<<<<<<<<<<<< * (n.old_dx + n.dx) * (n.old_dx + n.dx) + (n.old_dy + n.dy) * (n.old_dy + n.dy)) * */ - __pyx_t_6 = PyNumber_Multiply(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_t_6 = PyNumber_Multiply(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 260, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_totalEffectiveTraction = __pyx_t_7; - /* "fa2/fa2util.py":263 + /* "fa2/fa2util.py":257 * totalSwinging = 0.0 # How much irregular movement * totalEffectiveTraction = 0.0 # How much useful movement * for n in nodes: # <<<<<<<<<<<<<< @@ -8056,21 +7960,21 @@ static PyObject *__pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces(PyObject *__pyx } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "fa2/fa2util.py":272 + /* "fa2/fa2util.py":266 * # this network. Bigger networks need more tolerance. Denser * # networks need less tolerance. Totally empiric. * estimatedOptimalJitterTolerance = .05 * sqrt(len(nodes)) # <<<<<<<<<<<<<< * minJT = sqrt(estimatedOptimalJitterTolerance) * maxJT = 10 */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 272, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__pyx_v_nodes == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 272, __pyx_L1_error) + __PYX_ERR(2, 266, __pyx_L1_error) } - __pyx_t_2 = PyList_GET_SIZE(__pyx_v_nodes); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 272, __pyx_L1_error) - __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 272, __pyx_L1_error) + __pyx_t_2 = PyList_GET_SIZE(__pyx_v_nodes); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(2, 266, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -8085,26 +7989,26 @@ static PyObject *__pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces(PyObject *__pyx __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Multiply(__pyx_float__05, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 272, __pyx_L1_error) + __pyx_t_5 = PyNumber_Multiply(__pyx_float__05, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 272, __pyx_L1_error) + __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 266, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_estimatedOptimalJitterTolerance = __pyx_t_7; - /* "fa2/fa2util.py":273 + /* "fa2/fa2util.py":267 * # networks need less tolerance. Totally empiric. * estimatedOptimalJitterTolerance = .05 * sqrt(len(nodes)) * minJT = sqrt(estimatedOptimalJitterTolerance) # <<<<<<<<<<<<<< * maxJT = 10 * jt = jitterTolerance * max(minJT, */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyFloat_FromDouble(__pyx_v_estimatedOptimalJitterTolerance); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_t_6 = PyFloat_FromDouble(__pyx_v_estimatedOptimalJitterTolerance); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { @@ -8119,14 +8023,14 @@ static PyObject *__pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces(PyObject *__pyx __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 273, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 267, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_minJT = __pyx_t_7; - /* "fa2/fa2util.py":274 + /* "fa2/fa2util.py":268 * estimatedOptimalJitterTolerance = .05 * sqrt(len(nodes)) * minJT = sqrt(estimatedOptimalJitterTolerance) * maxJT = 10 # <<<<<<<<<<<<<< @@ -8135,7 +8039,7 @@ static PyObject *__pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces(PyObject *__pyx */ __pyx_v_maxJT = 10.0; - /* "fa2/fa2util.py":276 + /* "fa2/fa2util.py":270 * maxJT = 10 * jt = jitterTolerance * max(minJT, * min(maxJT, estimatedOptimalJitterTolerance * totalEffectiveTraction / ( # <<<<<<<<<<<<<< @@ -8144,7 +8048,7 @@ static PyObject *__pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces(PyObject *__pyx */ __pyx_t_7 = (__pyx_v_estimatedOptimalJitterTolerance * __pyx_v_totalEffectiveTraction); - /* "fa2/fa2util.py":277 + /* "fa2/fa2util.py":271 * jt = jitterTolerance * max(minJT, * min(maxJT, estimatedOptimalJitterTolerance * totalEffectiveTraction / ( * len(nodes) * len(nodes)))) # <<<<<<<<<<<<<< @@ -8153,17 +8057,17 @@ static PyObject *__pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces(PyObject *__pyx */ if (unlikely(__pyx_v_nodes == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 277, __pyx_L1_error) + __PYX_ERR(2, 271, __pyx_L1_error) } - __pyx_t_2 = PyList_GET_SIZE(__pyx_v_nodes); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 277, __pyx_L1_error) + __pyx_t_2 = PyList_GET_SIZE(__pyx_v_nodes); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(2, 271, __pyx_L1_error) if (unlikely(__pyx_v_nodes == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 277, __pyx_L1_error) + __PYX_ERR(2, 271, __pyx_L1_error) } - __pyx_t_10 = PyList_GET_SIZE(__pyx_v_nodes); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 277, __pyx_L1_error) + __pyx_t_10 = PyList_GET_SIZE(__pyx_v_nodes); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(2, 271, __pyx_L1_error) __pyx_t_11 = (__pyx_t_2 * __pyx_t_10); - /* "fa2/fa2util.py":276 + /* "fa2/fa2util.py":270 * maxJT = 10 * jt = jitterTolerance * max(minJT, * min(maxJT, estimatedOptimalJitterTolerance * totalEffectiveTraction / ( # <<<<<<<<<<<<<< @@ -8172,9 +8076,9 @@ static PyObject *__pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces(PyObject *__pyx */ if (unlikely(__pyx_t_11 == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 276, __pyx_L1_error) + __PYX_ERR(2, 270, __pyx_L1_error) } - __pyx_t_12 = (__pyx_t_7 / ((double)__pyx_t_11)); + __pyx_t_12 = (__pyx_t_7 / __pyx_t_11); __pyx_t_7 = __pyx_v_maxJT; if (((__pyx_t_12 < __pyx_t_7) != 0)) { __pyx_t_13 = __pyx_t_12; @@ -8183,7 +8087,7 @@ static PyObject *__pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces(PyObject *__pyx } __pyx_t_12 = __pyx_t_13; - /* "fa2/fa2util.py":275 + /* "fa2/fa2util.py":269 * minJT = sqrt(estimatedOptimalJitterTolerance) * maxJT = 10 * jt = jitterTolerance * max(minJT, # <<<<<<<<<<<<<< @@ -8192,7 +8096,7 @@ static PyObject *__pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces(PyObject *__pyx */ __pyx_t_13 = __pyx_v_minJT; - /* "fa2/fa2util.py":276 + /* "fa2/fa2util.py":270 * maxJT = 10 * jt = jitterTolerance * max(minJT, * min(maxJT, estimatedOptimalJitterTolerance * totalEffectiveTraction / ( # <<<<<<<<<<<<<< @@ -8205,7 +8109,7 @@ static PyObject *__pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces(PyObject *__pyx __pyx_t_7 = __pyx_t_13; } - /* "fa2/fa2util.py":275 + /* "fa2/fa2util.py":269 * minJT = sqrt(estimatedOptimalJitterTolerance) * maxJT = 10 * jt = jitterTolerance * max(minJT, # <<<<<<<<<<<<<< @@ -8214,7 +8118,7 @@ static PyObject *__pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces(PyObject *__pyx */ __pyx_v_jt = (__pyx_v_jitterTolerance * __pyx_t_7); - /* "fa2/fa2util.py":279 + /* "fa2/fa2util.py":273 * len(nodes) * len(nodes)))) * * minSpeedEfficiency = 0.05 # <<<<<<<<<<<<<< @@ -8223,23 +8127,31 @@ static PyObject *__pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces(PyObject *__pyx */ __pyx_v_minSpeedEfficiency = 0.05; - /* "fa2/fa2util.py":282 + /* "fa2/fa2util.py":276 * * # Protective against erratic behavior - * if totalSwinging / totalEffectiveTraction > 2.0: # <<<<<<<<<<<<<< + * if totalEffectiveTraction and totalSwinging / totalEffectiveTraction > 2.0: # <<<<<<<<<<<<<< * if speedEfficiency > minSpeedEfficiency: * speedEfficiency *= .5 */ + __pyx_t_15 = (__pyx_v_totalEffectiveTraction != 0); + if (__pyx_t_15) { + } else { + __pyx_t_14 = __pyx_t_15; + goto __pyx_L6_bool_binop_done; + } if (unlikely(__pyx_v_totalEffectiveTraction == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 282, __pyx_L1_error) + __PYX_ERR(2, 276, __pyx_L1_error) } - __pyx_t_14 = (((__pyx_v_totalSwinging / __pyx_v_totalEffectiveTraction) > 2.0) != 0); + __pyx_t_15 = (((__pyx_v_totalSwinging / __pyx_v_totalEffectiveTraction) > 2.0) != 0); + __pyx_t_14 = __pyx_t_15; + __pyx_L6_bool_binop_done:; if (__pyx_t_14) { - /* "fa2/fa2util.py":283 + /* "fa2/fa2util.py":277 * # Protective against erratic behavior - * if totalSwinging / totalEffectiveTraction > 2.0: + * if totalEffectiveTraction and totalSwinging / totalEffectiveTraction > 2.0: * if speedEfficiency > minSpeedEfficiency: # <<<<<<<<<<<<<< * speedEfficiency *= .5 * jt = max(jt, jitterTolerance) @@ -8247,8 +8159,8 @@ static PyObject *__pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces(PyObject *__pyx __pyx_t_14 = ((__pyx_v_speedEfficiency > __pyx_v_minSpeedEfficiency) != 0); if (__pyx_t_14) { - /* "fa2/fa2util.py":284 - * if totalSwinging / totalEffectiveTraction > 2.0: + /* "fa2/fa2util.py":278 + * if totalEffectiveTraction and totalSwinging / totalEffectiveTraction > 2.0: * if speedEfficiency > minSpeedEfficiency: * speedEfficiency *= .5 # <<<<<<<<<<<<<< * jt = max(jt, jitterTolerance) @@ -8256,16 +8168,16 @@ static PyObject *__pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces(PyObject *__pyx */ __pyx_v_speedEfficiency = (__pyx_v_speedEfficiency * .5); - /* "fa2/fa2util.py":283 + /* "fa2/fa2util.py":277 * # Protective against erratic behavior - * if totalSwinging / totalEffectiveTraction > 2.0: + * if totalEffectiveTraction and totalSwinging / totalEffectiveTraction > 2.0: * if speedEfficiency > minSpeedEfficiency: # <<<<<<<<<<<<<< * speedEfficiency *= .5 * jt = max(jt, jitterTolerance) */ } - /* "fa2/fa2util.py":285 + /* "fa2/fa2util.py":279 * if speedEfficiency > minSpeedEfficiency: * speedEfficiency *= .5 * jt = max(jt, jitterTolerance) # <<<<<<<<<<<<<< @@ -8281,16 +8193,16 @@ static PyObject *__pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces(PyObject *__pyx } __pyx_v_jt = __pyx_t_13; - /* "fa2/fa2util.py":282 + /* "fa2/fa2util.py":276 * * # Protective against erratic behavior - * if totalSwinging / totalEffectiveTraction > 2.0: # <<<<<<<<<<<<<< + * if totalEffectiveTraction and totalSwinging / totalEffectiveTraction > 2.0: # <<<<<<<<<<<<<< * if speedEfficiency > minSpeedEfficiency: * speedEfficiency *= .5 */ } - /* "fa2/fa2util.py":287 + /* "fa2/fa2util.py":281 * jt = max(jt, jitterTolerance) * * if totalSwinging == 0: # <<<<<<<<<<<<<< @@ -8300,27 +8212,27 @@ static PyObject *__pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces(PyObject *__pyx __pyx_t_14 = ((__pyx_v_totalSwinging == 0.0) != 0); if (__pyx_t_14) { - /* "fa2/fa2util.py":288 + /* "fa2/fa2util.py":282 * * if totalSwinging == 0: * targetSpeed = float('inf') # <<<<<<<<<<<<<< * else: * targetSpeed = jt * speedEfficiency * totalEffectiveTraction / totalSwinging */ - __pyx_t_13 = __Pyx_PyObject_AsDouble(__pyx_n_u_inf); if (unlikely(__pyx_t_13 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 288, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_AsDouble(__pyx_n_s_inf); if (unlikely(__pyx_t_13 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(2, 282, __pyx_L1_error) __pyx_v_targetSpeed = __pyx_t_13; - /* "fa2/fa2util.py":287 + /* "fa2/fa2util.py":281 * jt = max(jt, jitterTolerance) * * if totalSwinging == 0: # <<<<<<<<<<<<<< * targetSpeed = float('inf') * else: */ - goto __pyx_L7; + goto __pyx_L9; } - /* "fa2/fa2util.py":290 + /* "fa2/fa2util.py":284 * targetSpeed = float('inf') * else: * targetSpeed = jt * speedEfficiency * totalEffectiveTraction / totalSwinging # <<<<<<<<<<<<<< @@ -8331,13 +8243,13 @@ static PyObject *__pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces(PyObject *__pyx __pyx_t_13 = ((__pyx_v_jt * __pyx_v_speedEfficiency) * __pyx_v_totalEffectiveTraction); if (unlikely(__pyx_v_totalSwinging == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 290, __pyx_L1_error) + __PYX_ERR(2, 284, __pyx_L1_error) } __pyx_v_targetSpeed = (__pyx_t_13 / __pyx_v_totalSwinging); } - __pyx_L7:; + __pyx_L9:; - /* "fa2/fa2util.py":292 + /* "fa2/fa2util.py":286 * targetSpeed = jt * speedEfficiency * totalEffectiveTraction / totalSwinging * * if totalSwinging > jt * totalEffectiveTraction: # <<<<<<<<<<<<<< @@ -8347,7 +8259,7 @@ static PyObject *__pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces(PyObject *__pyx __pyx_t_14 = ((__pyx_v_totalSwinging > (__pyx_v_jt * __pyx_v_totalEffectiveTraction)) != 0); if (__pyx_t_14) { - /* "fa2/fa2util.py":293 + /* "fa2/fa2util.py":287 * * if totalSwinging > jt * totalEffectiveTraction: * if speedEfficiency > minSpeedEfficiency: # <<<<<<<<<<<<<< @@ -8357,7 +8269,7 @@ static PyObject *__pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces(PyObject *__pyx __pyx_t_14 = ((__pyx_v_speedEfficiency > __pyx_v_minSpeedEfficiency) != 0); if (__pyx_t_14) { - /* "fa2/fa2util.py":294 + /* "fa2/fa2util.py":288 * if totalSwinging > jt * totalEffectiveTraction: * if speedEfficiency > minSpeedEfficiency: * speedEfficiency *= .7 # <<<<<<<<<<<<<< @@ -8366,7 +8278,7 @@ static PyObject *__pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces(PyObject *__pyx */ __pyx_v_speedEfficiency = (__pyx_v_speedEfficiency * .7); - /* "fa2/fa2util.py":293 + /* "fa2/fa2util.py":287 * * if totalSwinging > jt * totalEffectiveTraction: * if speedEfficiency > minSpeedEfficiency: # <<<<<<<<<<<<<< @@ -8375,17 +8287,17 @@ static PyObject *__pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces(PyObject *__pyx */ } - /* "fa2/fa2util.py":292 + /* "fa2/fa2util.py":286 * targetSpeed = jt * speedEfficiency * totalEffectiveTraction / totalSwinging * * if totalSwinging > jt * totalEffectiveTraction: # <<<<<<<<<<<<<< * if speedEfficiency > minSpeedEfficiency: * speedEfficiency *= .7 */ - goto __pyx_L8; + goto __pyx_L10; } - /* "fa2/fa2util.py":295 + /* "fa2/fa2util.py":289 * if speedEfficiency > minSpeedEfficiency: * speedEfficiency *= .7 * elif speed < 1000: # <<<<<<<<<<<<<< @@ -8395,7 +8307,7 @@ static PyObject *__pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces(PyObject *__pyx __pyx_t_14 = ((__pyx_v_speed < 1000.0) != 0); if (__pyx_t_14) { - /* "fa2/fa2util.py":296 + /* "fa2/fa2util.py":290 * speedEfficiency *= .7 * elif speed < 1000: * speedEfficiency *= 1.3 # <<<<<<<<<<<<<< @@ -8404,7 +8316,7 @@ static PyObject *__pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces(PyObject *__pyx */ __pyx_v_speedEfficiency = (__pyx_v_speedEfficiency * 1.3); - /* "fa2/fa2util.py":295 + /* "fa2/fa2util.py":289 * if speedEfficiency > minSpeedEfficiency: * speedEfficiency *= .7 * elif speed < 1000: # <<<<<<<<<<<<<< @@ -8412,9 +8324,9 @@ static PyObject *__pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces(PyObject *__pyx * */ } - __pyx_L8:; + __pyx_L10:; - /* "fa2/fa2util.py":300 + /* "fa2/fa2util.py":294 * # But the speed shoudn't rise too much too quickly, since it would * # make the convergence drop dramatically. * maxRise = .5 # <<<<<<<<<<<<<< @@ -8423,7 +8335,7 @@ static PyObject *__pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces(PyObject *__pyx */ __pyx_v_maxRise = .5; - /* "fa2/fa2util.py":301 + /* "fa2/fa2util.py":295 * # make the convergence drop dramatically. * maxRise = .5 * speed = speed + min(targetSpeed - speed, maxRise * speed) # <<<<<<<<<<<<<< @@ -8439,7 +8351,7 @@ static PyObject *__pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces(PyObject *__pyx } __pyx_v_speed = (__pyx_v_speed + __pyx_t_12); - /* "fa2/fa2util.py":307 + /* "fa2/fa2util.py":301 * # Need to add a case if adjustSizes ("prevent overlap") is * # implemented. * for n in nodes: # <<<<<<<<<<<<<< @@ -8448,33 +8360,33 @@ static PyObject *__pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces(PyObject *__pyx */ if (unlikely(__pyx_v_nodes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 307, __pyx_L1_error) + __PYX_ERR(2, 301, __pyx_L1_error) } __pyx_t_5 = __pyx_v_nodes; __Pyx_INCREF(__pyx_t_5); __pyx_t_11 = 0; for (;;) { if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_11); __Pyx_INCREF(__pyx_t_1); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 307, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_11); __Pyx_INCREF(__pyx_t_1); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(2, 301, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(0, 307, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3fa2_7fa2util_Node))))) __PYX_ERR(2, 301, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_n, ((struct __pyx_obj_3fa2_7fa2util_Node *)__pyx_t_1)); __pyx_t_1 = 0; - /* "fa2/fa2util.py":308 + /* "fa2/fa2util.py":302 * # implemented. * for n in nodes: * swinging = n.mass * sqrt((n.old_dx - n.dx) * (n.old_dx - n.dx) + (n.old_dy - n.dy) * (n.old_dy - n.dy)) # <<<<<<<<<<<<<< * factor = speed / (1.0 + sqrt(speed * swinging)) * n.x = n.x + (n.dx * factor) */ - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_n->mass); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_n->mass); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyFloat_FromDouble((((__pyx_v_n->old_dx - __pyx_v_n->dx) * (__pyx_v_n->old_dx - __pyx_v_n->dx)) + ((__pyx_v_n->old_dy - __pyx_v_n->dy) * (__pyx_v_n->old_dy - __pyx_v_n->dy)))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_t_4 = PyFloat_FromDouble((((__pyx_v_n->old_dx - __pyx_v_n->dx) * (__pyx_v_n->old_dx - __pyx_v_n->dx)) + ((__pyx_v_n->old_dy - __pyx_v_n->dy) * (__pyx_v_n->old_dy - __pyx_v_n->dy)))); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -8489,29 +8401,29 @@ static PyObject *__pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces(PyObject *__pyx __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_8, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 308, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 302, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_swinging = __pyx_t_12; - /* "fa2/fa2util.py":309 + /* "fa2/fa2util.py":303 * for n in nodes: * swinging = n.mass * sqrt((n.old_dx - n.dx) * (n.old_dx - n.dx) + (n.old_dy - n.dy) * (n.old_dy - n.dy)) * factor = speed / (1.0 + sqrt(speed * swinging)) # <<<<<<<<<<<<<< * n.x = n.x + (n.dx * factor) * n.y = n.y + (n.dy * factor) */ - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_speed); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_speed); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyFloat_FromDouble((__pyx_v_speed * __pyx_v_swinging)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_4 = PyFloat_FromDouble((__pyx_v_speed * __pyx_v_swinging)); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { @@ -8526,21 +8438,21 @@ static PyObject *__pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces(PyObject *__pyx __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_8, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 309, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyFloat_AddCObj(__pyx_float_1_0, __pyx_t_6, 1.0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFloat_AddCObj(__pyx_float_1_0, __pyx_t_6, 1.0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 303, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_factor = __pyx_t_12; - /* "fa2/fa2util.py":310 + /* "fa2/fa2util.py":304 * swinging = n.mass * sqrt((n.old_dx - n.dx) * (n.old_dx - n.dx) + (n.old_dy - n.dy) * (n.old_dy - n.dy)) * factor = speed / (1.0 + sqrt(speed * swinging)) * n.x = n.x + (n.dx * factor) # <<<<<<<<<<<<<< @@ -8549,7 +8461,7 @@ static PyObject *__pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces(PyObject *__pyx */ __pyx_v_n->x = (__pyx_v_n->x + (__pyx_v_n->dx * __pyx_v_factor)); - /* "fa2/fa2util.py":311 + /* "fa2/fa2util.py":305 * factor = speed / (1.0 + sqrt(speed * swinging)) * n.x = n.x + (n.dx * factor) * n.y = n.y + (n.dy * factor) # <<<<<<<<<<<<<< @@ -8558,7 +8470,7 @@ static PyObject *__pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces(PyObject *__pyx */ __pyx_v_n->y = (__pyx_v_n->y + (__pyx_v_n->dy * __pyx_v_factor)); - /* "fa2/fa2util.py":307 + /* "fa2/fa2util.py":301 * # Need to add a case if adjustSizes ("prevent overlap") is * # implemented. * for n in nodes: # <<<<<<<<<<<<<< @@ -8568,43 +8480,43 @@ static PyObject *__pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces(PyObject *__pyx } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "fa2/fa2util.py":313 + /* "fa2/fa2util.py":307 * n.y = n.y + (n.dy * factor) * * values = {} # <<<<<<<<<<<<<< * values['speed'] = speed * values['speedEfficiency'] = speedEfficiency */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 313, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_values = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; - /* "fa2/fa2util.py":314 + /* "fa2/fa2util.py":308 * * values = {} * values['speed'] = speed # <<<<<<<<<<<<<< * values['speedEfficiency'] = speedEfficiency * */ - __pyx_t_5 = PyFloat_FromDouble(__pyx_v_speed); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 314, __pyx_L1_error) + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_speed); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_values, __pyx_n_u_speed, __pyx_t_5) < 0)) __PYX_ERR(0, 314, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_values, __pyx_n_s_speed, __pyx_t_5) < 0)) __PYX_ERR(2, 308, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "fa2/fa2util.py":315 + /* "fa2/fa2util.py":309 * values = {} * values['speed'] = speed * values['speedEfficiency'] = speedEfficiency # <<<<<<<<<<<<<< * * return values */ - __pyx_t_5 = PyFloat_FromDouble(__pyx_v_speedEfficiency); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_speedEfficiency); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_values, __pyx_n_u_speedEfficiency, __pyx_t_5) < 0)) __PYX_ERR(0, 315, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_values, __pyx_n_s_speedEfficiency, __pyx_t_5) < 0)) __PYX_ERR(2, 309, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "fa2/fa2util.py":317 + /* "fa2/fa2util.py":311 * values['speedEfficiency'] = speedEfficiency * * return values # <<<<<<<<<<<<<< @@ -8616,7 +8528,7 @@ static PyObject *__pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces(PyObject *__pyx __pyx_r = __pyx_v_values; goto __pyx_L0; - /* "fa2/fa2util.py":259 + /* "fa2/fa2util.py":253 * * # Adjust speed and apply forces step * def adjustSpeedAndApplyForces(nodes, speed, speedEfficiency, jitterTolerance): # <<<<<<<<<<<<<< @@ -8681,23 +8593,23 @@ static PyObject *__pyx_pw_3fa2_7fa2util_9adjustSpeedAndApplyForces(PyObject *__p case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_speed)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("adjustSpeedAndApplyForces", 1, 4, 4, 1); __PYX_ERR(0, 259, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("adjustSpeedAndApplyForces", 1, 4, 4, 1); __PYX_ERR(2, 253, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_speedEfficiency)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("adjustSpeedAndApplyForces", 1, 4, 4, 2); __PYX_ERR(0, 259, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("adjustSpeedAndApplyForces", 1, 4, 4, 2); __PYX_ERR(2, 253, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_jitterTolerance)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("adjustSpeedAndApplyForces", 1, 4, 4, 3); __PYX_ERR(0, 259, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("adjustSpeedAndApplyForces", 1, 4, 4, 3); __PYX_ERR(2, 253, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "adjustSpeedAndApplyForces") < 0)) __PYX_ERR(0, 259, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "adjustSpeedAndApplyForces") < 0)) __PYX_ERR(2, 253, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -8708,19 +8620,19 @@ static PyObject *__pyx_pw_3fa2_7fa2util_9adjustSpeedAndApplyForces(PyObject *__p values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_nodes = ((PyObject*)values[0]); - __pyx_v_speed = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_speed == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 259, __pyx_L3_error) - __pyx_v_speedEfficiency = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_speedEfficiency == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 259, __pyx_L3_error) - __pyx_v_jitterTolerance = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_jitterTolerance == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 259, __pyx_L3_error) + __pyx_v_speed = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_speed == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 253, __pyx_L3_error) + __pyx_v_speedEfficiency = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_speedEfficiency == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 253, __pyx_L3_error) + __pyx_v_jitterTolerance = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_jitterTolerance == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 253, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("adjustSpeedAndApplyForces", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 259, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("adjustSpeedAndApplyForces", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 253, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fa2.fa2util.adjustSpeedAndApplyForces", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodes), (&PyList_Type), 1, "nodes", 1))) __PYX_ERR(0, 259, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodes), (&PyList_Type), 1, "nodes", 1))) __PYX_ERR(2, 253, __pyx_L1_error) __pyx_r = __pyx_pf_3fa2_7fa2util_8adjustSpeedAndApplyForces(__pyx_self, __pyx_v_nodes, __pyx_v_speed, __pyx_v_speedEfficiency, __pyx_v_jitterTolerance); /* function exit code */ @@ -8738,7 +8650,7 @@ static PyObject *__pyx_pf_3fa2_7fa2util_8adjustSpeedAndApplyForces(CYTHON_UNUSED PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("adjustSpeedAndApplyForces", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces(__pyx_v_nodes, __pyx_v_speed, __pyx_v_speedEfficiency, __pyx_v_jitterTolerance, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error) + __pyx_t_1 = __pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces(__pyx_v_nodes, __pyx_v_speed, __pyx_v_speedEfficiency, __pyx_v_jitterTolerance, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -8796,17 +8708,17 @@ static PyObject *__pyx_pw_3fa2_7fa2util_11__pyx_unpickle_Node(PyObject *__pyx_se case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Node", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Node", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Node", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Node", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Node") < 0)) __PYX_ERR(2, 1, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Node") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -8816,12 +8728,12 @@ static PyObject *__pyx_pw_3fa2_7fa2util_11__pyx_unpickle_Node(PyObject *__pyx_se values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v___pyx_type = values[0]; - __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error) + __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) __pyx_v___pyx_state = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Node", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Node", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fa2.fa2util.__pyx_unpickle_Node", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -8864,15 +8776,15 @@ static PyObject *__pyx_pf_3fa2_7fa2util_10__pyx_unpickle_Node(CYTHON_UNUSED PyOb * raise __pyx_PickleError("Incompatible checksums (%s vs 0x2f233dd = (dx, dy, mass, old_dx, old_dy, x, y))" % __pyx_checksum) * __pyx_result = Node.__new__(__pyx_type) */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error) + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_PickleError); __Pyx_GIVEREF(__pyx_n_s_PickleError); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) + __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_2); __pyx_v___pyx_PickleError = __pyx_t_2; @@ -8886,9 +8798,9 @@ static PyObject *__pyx_pf_3fa2_7fa2util_10__pyx_unpickle_Node(CYTHON_UNUSED PyOb * __pyx_result = Node.__new__(__pyx_type) * if __pyx_state is not None: */ - __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x2f, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x2f, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_INCREF(__pyx_v___pyx_PickleError); @@ -8905,12 +8817,12 @@ static PyObject *__pyx_pf_3fa2_7fa2util_10__pyx_unpickle_Node(CYTHON_UNUSED PyOb __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 6, __pyx_L1_error) + __PYX_ERR(1, 6, __pyx_L1_error) /* "(tree fragment)":4 * cdef object __pyx_PickleError @@ -8928,7 +8840,7 @@ static PyObject *__pyx_pf_3fa2_7fa2util_10__pyx_unpickle_Node(CYTHON_UNUSED PyOb * if __pyx_state is not None: * __pyx_unpickle_Node__set_state( __pyx_result, __pyx_state) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_3fa2_7fa2util_Node), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_3fa2_7fa2util_Node), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -8942,7 +8854,7 @@ static PyObject *__pyx_pf_3fa2_7fa2util_10__pyx_unpickle_Node(CYTHON_UNUSED PyOb } __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v___pyx_result = __pyx_t_3; @@ -8966,8 +8878,8 @@ static PyObject *__pyx_pf_3fa2_7fa2util_10__pyx_unpickle_Node(CYTHON_UNUSED PyOb * return __pyx_result * cdef __pyx_unpickle_Node__set_state(Node __pyx_result, tuple __pyx_state): */ - if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 9, __pyx_L1_error) - __pyx_t_3 = __pyx_f_3fa2_7fa2util___pyx_unpickle_Node__set_state(((struct __pyx_obj_3fa2_7fa2util_Node *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9, __pyx_L1_error) + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error) + __pyx_t_3 = __pyx_f_3fa2_7fa2util___pyx_unpickle_Node__set_state(((struct __pyx_obj_3fa2_7fa2util_Node *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -9045,65 +8957,65 @@ static PyObject *__pyx_f_3fa2_7fa2util___pyx_unpickle_Node__set_state(struct __p */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(2, 12, __pyx_L1_error) + __PYX_ERR(1, 12, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->dx = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(2, 12, __pyx_L1_error) + __PYX_ERR(1, 12, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->dy = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(2, 12, __pyx_L1_error) + __PYX_ERR(1, 12, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->mass = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(2, 12, __pyx_L1_error) + __PYX_ERR(1, 12, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->old_dx = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(2, 12, __pyx_L1_error) + __PYX_ERR(1, 12, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->old_dy = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(2, 12, __pyx_L1_error) + __PYX_ERR(1, 12, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->x = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(2, 12, __pyx_L1_error) + __PYX_ERR(1, 12, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->y = __pyx_t_2; @@ -9115,16 +9027,16 @@ static PyObject *__pyx_f_3fa2_7fa2util___pyx_unpickle_Node__set_state(struct __p */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(2, 13, __pyx_L1_error) + __PYX_ERR(1, 13, __pyx_L1_error) } - __pyx_t_4 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error) __pyx_t_5 = ((__pyx_t_4 > 7) != 0); if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } - __pyx_t_5 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error) + __pyx_t_5 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error) __pyx_t_6 = (__pyx_t_5 != 0); __pyx_t_3 = __pyx_t_6; __pyx_L4_bool_binop_done:; @@ -9135,16 +9047,16 @@ static PyObject *__pyx_f_3fa2_7fa2util___pyx_unpickle_Node__set_state(struct __p * if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[7]) # <<<<<<<<<<<<<< */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 14, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 14, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(2, 14, __pyx_L1_error) + __PYX_ERR(1, 14, __pyx_L1_error) } - __pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 14, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { @@ -9159,7 +9071,7 @@ static PyObject *__pyx_f_3fa2_7fa2util___pyx_unpickle_Node__set_state(struct __p __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -9237,17 +9149,17 @@ static PyObject *__pyx_pw_3fa2_7fa2util_13__pyx_unpickle_Edge(PyObject *__pyx_se case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Edge", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Edge", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Edge", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Edge", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Edge") < 0)) __PYX_ERR(2, 1, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Edge") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -9257,12 +9169,12 @@ static PyObject *__pyx_pw_3fa2_7fa2util_13__pyx_unpickle_Edge(PyObject *__pyx_se values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v___pyx_type = values[0]; - __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error) + __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) __pyx_v___pyx_state = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Edge", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Edge", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fa2.fa2util.__pyx_unpickle_Edge", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -9305,15 +9217,15 @@ static PyObject *__pyx_pf_3fa2_7fa2util_12__pyx_unpickle_Edge(CYTHON_UNUSED PyOb * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb469544 = (node1, node2, weight))" % __pyx_checksum) * __pyx_result = Edge.__new__(__pyx_type) */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error) + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_PickleError); __Pyx_GIVEREF(__pyx_n_s_PickleError); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) + __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_2); __pyx_v___pyx_PickleError = __pyx_t_2; @@ -9327,9 +9239,9 @@ static PyObject *__pyx_pf_3fa2_7fa2util_12__pyx_unpickle_Edge(CYTHON_UNUSED PyOb * __pyx_result = Edge.__new__(__pyx_type) * if __pyx_state is not None: */ - __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb4, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb4, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_INCREF(__pyx_v___pyx_PickleError); @@ -9346,12 +9258,12 @@ static PyObject *__pyx_pf_3fa2_7fa2util_12__pyx_unpickle_Edge(CYTHON_UNUSED PyOb __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 6, __pyx_L1_error) + __PYX_ERR(1, 6, __pyx_L1_error) /* "(tree fragment)":4 * cdef object __pyx_PickleError @@ -9369,7 +9281,7 @@ static PyObject *__pyx_pf_3fa2_7fa2util_12__pyx_unpickle_Edge(CYTHON_UNUSED PyOb * if __pyx_state is not None: * __pyx_unpickle_Edge__set_state( __pyx_result, __pyx_state) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_3fa2_7fa2util_Edge), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_3fa2_7fa2util_Edge), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -9383,7 +9295,7 @@ static PyObject *__pyx_pf_3fa2_7fa2util_12__pyx_unpickle_Edge(CYTHON_UNUSED PyOb } __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v___pyx_result = __pyx_t_3; @@ -9407,8 +9319,8 @@ static PyObject *__pyx_pf_3fa2_7fa2util_12__pyx_unpickle_Edge(CYTHON_UNUSED PyOb * return __pyx_result * cdef __pyx_unpickle_Edge__set_state(Edge __pyx_result, tuple __pyx_state): */ - if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 9, __pyx_L1_error) - __pyx_t_3 = __pyx_f_3fa2_7fa2util___pyx_unpickle_Edge__set_state(((struct __pyx_obj_3fa2_7fa2util_Edge *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9, __pyx_L1_error) + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error) + __pyx_t_3 = __pyx_f_3fa2_7fa2util___pyx_unpickle_Edge__set_state(((struct __pyx_obj_3fa2_7fa2util_Edge *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -9487,29 +9399,29 @@ static PyObject *__pyx_f_3fa2_7fa2util___pyx_unpickle_Edge__set_state(struct __p */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(2, 12, __pyx_L1_error) + __PYX_ERR(1, 12, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->node1 = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(2, 12, __pyx_L1_error) + __PYX_ERR(1, 12, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->node2 = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(2, 12, __pyx_L1_error) + __PYX_ERR(1, 12, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->weight = __pyx_t_3; @@ -9521,16 +9433,16 @@ static PyObject *__pyx_f_3fa2_7fa2util___pyx_unpickle_Edge__set_state(struct __p */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(2, 13, __pyx_L1_error) + __PYX_ERR(1, 13, __pyx_L1_error) } - __pyx_t_5 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error) __pyx_t_6 = ((__pyx_t_5 > 3) != 0); if (__pyx_t_6) { } else { __pyx_t_4 = __pyx_t_6; goto __pyx_L4_bool_binop_done; } - __pyx_t_6 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error) + __pyx_t_6 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error) __pyx_t_7 = (__pyx_t_6 != 0); __pyx_t_4 = __pyx_t_7; __pyx_L4_bool_binop_done:; @@ -9541,16 +9453,16 @@ static PyObject *__pyx_f_3fa2_7fa2util___pyx_unpickle_Edge__set_state(struct __p * if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[3]) # <<<<<<<<<<<<<< */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 14, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_update); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 14, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_update); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(2, 14, __pyx_L1_error) + __PYX_ERR(1, 14, __pyx_L1_error) } - __pyx_t_8 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 14, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { @@ -9565,7 +9477,7 @@ static PyObject *__pyx_f_3fa2_7fa2util___pyx_unpickle_Edge__set_state(struct __p __pyx_t_1 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -9643,17 +9555,17 @@ static PyObject *__pyx_pw_3fa2_7fa2util_15__pyx_unpickle_Region(PyObject *__pyx_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Region", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Region", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Region", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Region", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Region") < 0)) __PYX_ERR(2, 1, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Region") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -9663,12 +9575,12 @@ static PyObject *__pyx_pw_3fa2_7fa2util_15__pyx_unpickle_Region(PyObject *__pyx_ values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v___pyx_type = values[0]; - __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error) + __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) __pyx_v___pyx_state = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Region", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Region", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("fa2.fa2util.__pyx_unpickle_Region", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -9711,15 +9623,15 @@ static PyObject *__pyx_pf_3fa2_7fa2util_14__pyx_unpickle_Region(CYTHON_UNUSED Py * raise __pyx_PickleError("Incompatible checksums (%s vs 0x66ef4c7 = (mass, massCenterX, massCenterY, nodes, size, subregions))" % __pyx_checksum) * __pyx_result = Region.__new__(__pyx_type) */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error) + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_PickleError); __Pyx_GIVEREF(__pyx_n_s_PickleError); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) + __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_2); __pyx_v___pyx_PickleError = __pyx_t_2; @@ -9733,9 +9645,9 @@ static PyObject *__pyx_pf_3fa2_7fa2util_14__pyx_unpickle_Region(CYTHON_UNUSED Py * __pyx_result = Region.__new__(__pyx_type) * if __pyx_state is not None: */ - __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x66, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x66, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_INCREF(__pyx_v___pyx_PickleError); @@ -9752,12 +9664,12 @@ static PyObject *__pyx_pf_3fa2_7fa2util_14__pyx_unpickle_Region(CYTHON_UNUSED Py __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 6, __pyx_L1_error) + __PYX_ERR(1, 6, __pyx_L1_error) /* "(tree fragment)":4 * cdef object __pyx_PickleError @@ -9775,7 +9687,7 @@ static PyObject *__pyx_pf_3fa2_7fa2util_14__pyx_unpickle_Region(CYTHON_UNUSED Py * if __pyx_state is not None: * __pyx_unpickle_Region__set_state( __pyx_result, __pyx_state) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_3fa2_7fa2util_Region), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_3fa2_7fa2util_Region), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -9789,7 +9701,7 @@ static PyObject *__pyx_pf_3fa2_7fa2util_14__pyx_unpickle_Region(CYTHON_UNUSED Py } __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v___pyx_result = __pyx_t_3; @@ -9813,8 +9725,8 @@ static PyObject *__pyx_pf_3fa2_7fa2util_14__pyx_unpickle_Region(CYTHON_UNUSED Py * return __pyx_result * cdef __pyx_unpickle_Region__set_state(Region __pyx_result, tuple __pyx_state): */ - if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 9, __pyx_L1_error) - __pyx_t_3 = __pyx_f_3fa2_7fa2util___pyx_unpickle_Region__set_state(((struct __pyx_obj_3fa2_7fa2util_Region *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9, __pyx_L1_error) + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error) + __pyx_t_3 = __pyx_f_3fa2_7fa2util___pyx_unpickle_Region__set_state(((struct __pyx_obj_3fa2_7fa2util_Region *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -9892,38 +9804,38 @@ static PyObject *__pyx_f_3fa2_7fa2util___pyx_unpickle_Region__set_state(struct _ */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(2, 12, __pyx_L1_error) + __PYX_ERR(1, 12, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->mass = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(2, 12, __pyx_L1_error) + __PYX_ERR(1, 12, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->massCenterX = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(2, 12, __pyx_L1_error) + __PYX_ERR(1, 12, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->massCenterY = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(2, 12, __pyx_L1_error) + __PYX_ERR(1, 12, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(2, 12, __pyx_L1_error) + if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->nodes); __Pyx_DECREF(__pyx_v___pyx_result->nodes); @@ -9931,20 +9843,20 @@ static PyObject *__pyx_f_3fa2_7fa2util___pyx_unpickle_Region__set_state(struct _ __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(2, 12, __pyx_L1_error) + __PYX_ERR(1, 12, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->size = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(2, 12, __pyx_L1_error) + __PYX_ERR(1, 12, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(2, 12, __pyx_L1_error) + if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->subregions); __Pyx_DECREF(__pyx_v___pyx_result->subregions); @@ -9959,16 +9871,16 @@ static PyObject *__pyx_f_3fa2_7fa2util___pyx_unpickle_Region__set_state(struct _ */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(2, 13, __pyx_L1_error) + __PYX_ERR(1, 13, __pyx_L1_error) } - __pyx_t_4 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error) __pyx_t_5 = ((__pyx_t_4 > 6) != 0); if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } - __pyx_t_5 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error) + __pyx_t_5 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error) __pyx_t_6 = (__pyx_t_5 != 0); __pyx_t_3 = __pyx_t_6; __pyx_L4_bool_binop_done:; @@ -9979,16 +9891,16 @@ static PyObject *__pyx_f_3fa2_7fa2util___pyx_unpickle_Region__set_state(struct _ * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[6]) # <<<<<<<<<<<<<< */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 14, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 14, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(2, 14, __pyx_L1_error) + __PYX_ERR(1, 14, __pyx_L1_error) } - __pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 14, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { @@ -10003,7 +9915,7 @@ static PyObject *__pyx_f_3fa2_7fa2util___pyx_unpickle_Region__set_state(struct _ __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -10181,7 +10093,12 @@ static PyTypeObject __pyx_type_3fa2_7fa2util_Node = { sizeof(struct __pyx_obj_3fa2_7fa2util_Node), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_3fa2_7fa2util_Node, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -10234,6 +10151,9 @@ static PyTypeObject __pyx_type_3fa2_7fa2util_Node = { #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static PyObject *__pyx_tp_new_3fa2_7fa2util_Edge(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { @@ -10317,7 +10237,12 @@ static PyTypeObject __pyx_type_3fa2_7fa2util_Edge = { sizeof(struct __pyx_obj_3fa2_7fa2util_Edge), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_3fa2_7fa2util_Edge, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -10370,6 +10295,9 @@ static PyTypeObject __pyx_type_3fa2_7fa2util_Edge = { #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_vtabstruct_3fa2_7fa2util_Region __pyx_vtable_3fa2_7fa2util_Region; @@ -10530,7 +10458,12 @@ static PyTypeObject __pyx_type_3fa2_7fa2util_Region = { sizeof(struct __pyx_obj_3fa2_7fa2util_Region), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_3fa2_7fa2util_Region, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -10583,6 +10516,9 @@ static PyTypeObject __pyx_type_3fa2_7fa2util_Region = { #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static PyMethodDef __pyx_methods[] = { @@ -10637,7 +10573,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_Incompatible_checksums_s_vs_0x2f, __pyx_k_Incompatible_checksums_s_vs_0x2f, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x2f), 0, 0, 1, 0}, {&__pyx_kp_s_Incompatible_checksums_s_vs_0x66, __pyx_k_Incompatible_checksums_s_vs_0x66, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x66), 0, 0, 1, 0}, {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb4, __pyx_k_Incompatible_checksums_s_vs_0xb4, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb4), 0, 0, 1, 0}, - {&__pyx_kp_u_No_cython_detected_Install_cytho, __pyx_k_No_cython_detected_Install_cytho, sizeof(__pyx_k_No_cython_detected_Install_cytho), 0, 1, 0, 0}, + {&__pyx_kp_s_No_cython_detected_Install_cytho, __pyx_k_No_cython_detected_Install_cytho, sizeof(__pyx_k_No_cython_detected_Install_cytho), 0, 0, 1, 0}, {&__pyx_n_s_Node, __pyx_k_Node, sizeof(__pyx_k_Node), 0, 0, 1, 1}, {&__pyx_n_s_Node___reduce_cython, __pyx_k_Node___reduce_cython, sizeof(__pyx_k_Node___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_Node___setstate_cython, __pyx_k_Node___setstate_cython, sizeof(__pyx_k_Node___setstate_cython), 0, 0, 1, 1}, @@ -10647,7 +10583,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_Region___setstate_cython, __pyx_k_Region___setstate_cython, sizeof(__pyx_k_Region___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_Region_applyForceOnNodes, __pyx_k_Region_applyForceOnNodes, sizeof(__pyx_k_Region_applyForceOnNodes), 0, 0, 1, 1}, {&__pyx_n_s_Region_buildSubRegions, __pyx_k_Region_buildSubRegions, sizeof(__pyx_k_Region_buildSubRegions), 0, 0, 1, 1}, - {&__pyx_kp_u_Warning_uncompiled_fa2util_modul, __pyx_k_Warning_uncompiled_fa2util_modul, sizeof(__pyx_k_Warning_uncompiled_fa2util_modul), 0, 1, 0, 0}, + {&__pyx_kp_s_Warning_uncompiled_fa2util_modul, __pyx_k_Warning_uncompiled_fa2util_modul, sizeof(__pyx_k_Warning_uncompiled_fa2util_modul), 0, 0, 1, 0}, {&__pyx_n_s_adjustSpeedAndApplyForces, __pyx_k_adjustSpeedAndApplyForces, sizeof(__pyx_k_adjustSpeedAndApplyForces), 0, 0, 1, 1}, {&__pyx_n_s_applyForceOnNodes, __pyx_k_applyForceOnNodes, sizeof(__pyx_k_applyForceOnNodes), 0, 0, 1, 1}, {&__pyx_n_s_apply_attraction, __pyx_k_apply_attraction, sizeof(__pyx_k_apply_attraction), 0, 0, 1, 1}, @@ -10662,12 +10598,14 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1}, {&__pyx_n_s_edgeWeightInfluence, __pyx_k_edgeWeightInfluence, sizeof(__pyx_k_edgeWeightInfluence), 0, 0, 1, 1}, {&__pyx_n_s_edges, __pyx_k_edges, sizeof(__pyx_k_edges), 0, 0, 1, 1}, + {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, {&__pyx_n_s_fa2_fa2util, __pyx_k_fa2_fa2util, sizeof(__pyx_k_fa2_fa2util), 0, 0, 1, 1}, - {&__pyx_kp_s_fa2_fa2util_py, __pyx_k_fa2_fa2util_py, sizeof(__pyx_k_fa2_fa2util_py), 0, 0, 1, 0}, + {&__pyx_kp_s_fa2util_py, __pyx_k_fa2util_py, sizeof(__pyx_k_fa2util_py), 0, 0, 1, 0}, + {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_n_s_gravity, __pyx_k_gravity, sizeof(__pyx_k_gravity), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, - {&__pyx_n_u_inf, __pyx_k_inf, sizeof(__pyx_k_inf), 0, 1, 0, 1}, + {&__pyx_n_s_inf, __pyx_k_inf, sizeof(__pyx_k_inf), 0, 0, 1, 1}, {&__pyx_n_s_jitterTolerance, __pyx_k_jitterTolerance, sizeof(__pyx_k_jitterTolerance), 0, 0, 1, 1}, {&__pyx_n_s_linAttraction, __pyx_k_linAttraction, sizeof(__pyx_k_linAttraction), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, @@ -10696,9 +10634,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_speed, __pyx_k_speed, sizeof(__pyx_k_speed), 0, 0, 1, 1}, - {&__pyx_n_u_speed, __pyx_k_speed, sizeof(__pyx_k_speed), 0, 1, 0, 1}, {&__pyx_n_s_speedEfficiency, __pyx_k_speedEfficiency, sizeof(__pyx_k_speedEfficiency), 0, 0, 1, 1}, - {&__pyx_n_u_speedEfficiency, __pyx_k_speedEfficiency, sizeof(__pyx_k_speedEfficiency), 0, 1, 0, 1}, {&__pyx_n_s_sqrt, __pyx_k_sqrt, sizeof(__pyx_k_sqrt), 0, 0, 1, 1}, {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, @@ -10710,10 +10646,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, 0, 0, 0, 0, 0, 0} }; static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_n_s_print); if (!__pyx_builtin_print) __PYX_ERR(0, 324, __pyx_L1_error) return 0; - __pyx_L1_error:; - return -1; } static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { @@ -10725,10 +10658,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * cdef tuple state * cdef object _dict */ - __pyx_tuple_ = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple_)) __PYX_ERR(2, 1, __pyx_L1_error) + __pyx_tuple_ = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple_, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(2, 1, __pyx_L1_error) + __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple_, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":16 * else: @@ -10736,20 +10669,20 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_Node__set_state(self, __pyx_state) */ - __pyx_tuple__3 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(2, 16, __pyx_L1_error) + __pyx_tuple__3 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); - __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(2, 16, __pyx_L1_error) + __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(1, 16, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ - __pyx_tuple__5 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(2, 1, __pyx_L1_error) + __pyx_tuple__5 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); - __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(2, 1, __pyx_L1_error) + __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":16 * else: @@ -10757,10 +10690,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_Edge__set_state(self, __pyx_state) */ - __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 16, __pyx_L1_error) + __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); - __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(2, 16, __pyx_L1_error) + __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(1, 16, __pyx_L1_error) /* "fa2/fa2util.py":97 * # adjust the dx and dy values of `n1` and `n2`. It does @@ -10769,10 +10702,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * xDist = n1.x - n2.x * yDist = n1.y - n2.y */ - __pyx_tuple__9 = PyTuple_Pack(5, __pyx_n_s_n1, __pyx_n_s_n2, __pyx_n_s_e, __pyx_n_s_distributedAttraction, __pyx_n_s_coefficient); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_tuple__9 = PyTuple_Pack(5, __pyx_n_s_n1, __pyx_n_s_n2, __pyx_n_s_e, __pyx_n_s_distributedAttraction, __pyx_n_s_coefficient); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); - __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fa2_fa2util_py, __pyx_n_s_linAttraction, 97, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fa2util_py, __pyx_n_s_linAttraction, 97, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(2, 97, __pyx_L1_error) /* "fa2/fa2util.py":113 * # the forces directly to the node objects. These iterations are here @@ -10781,10 +10714,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * i = 0 * for n1 in nodes: */ - __pyx_tuple__11 = PyTuple_Pack(2, __pyx_n_s_nodes, __pyx_n_s_coefficient); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 113, __pyx_L1_error) + __pyx_tuple__11 = PyTuple_Pack(2, __pyx_n_s_nodes, __pyx_n_s_coefficient); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); - __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 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_fa2_fa2util_py, __pyx_n_s_apply_repulsion, 113, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 113, __pyx_L1_error) + __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 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_fa2util_py, __pyx_n_s_apply_repulsion, 113, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(2, 113, __pyx_L1_error) /* "fa2/fa2util.py":125 * @@ -10793,10 +10726,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * if not useStrongGravity: * for n in nodes: */ - __pyx_tuple__13 = PyTuple_Pack(4, __pyx_n_s_nodes, __pyx_n_s_gravity, __pyx_n_s_scalingRatio, __pyx_n_s_useStrongGravity); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_tuple__13 = PyTuple_Pack(4, __pyx_n_s_nodes, __pyx_n_s_gravity, __pyx_n_s_scalingRatio, __pyx_n_s_useStrongGravity); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); - __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 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_fa2_fa2util_py, __pyx_n_s_apply_gravity, 125, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 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_fa2util_py, __pyx_n_s_apply_gravity, 125, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(2, 125, __pyx_L1_error) /* "fa2/fa2util.py":134 * @@ -10805,44 +10738,44 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * # Optimization, since usually edgeWeightInfluence is 0 or 1, and pow is slow * if edgeWeightInfluence == 0: */ - __pyx_tuple__15 = PyTuple_Pack(5, __pyx_n_s_nodes, __pyx_n_s_edges, __pyx_n_s_distributedAttraction, __pyx_n_s_coefficient, __pyx_n_s_edgeWeightInfluence); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 134, __pyx_L1_error) + __pyx_tuple__15 = PyTuple_Pack(5, __pyx_n_s_nodes, __pyx_n_s_edges, __pyx_n_s_distributedAttraction, __pyx_n_s_coefficient, __pyx_n_s_edgeWeightInfluence); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); - __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 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_fa2_fa2util_py, __pyx_n_s_apply_attraction, 134, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 134, __pyx_L1_error) + __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 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_fa2util_py, __pyx_n_s_apply_attraction, 134, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(2, 134, __pyx_L1_error) /* "fa2/fa2util.py":176 * self.size = max(self.size, 2 * distance) * * def buildSubRegions(self): # <<<<<<<<<<<<<< * if len(self.nodes) > 1: - * + * topleftNodes = [] */ - __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 176, __pyx_L1_error) + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(2, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); - __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 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_fa2_fa2util_py, __pyx_n_s_buildSubRegions, 176, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 176, __pyx_L1_error) + __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 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_fa2util_py, __pyx_n_s_buildSubRegions, 176, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(2, 176, __pyx_L1_error) - /* "fa2/fa2util.py":253 + /* "fa2/fa2util.py":247 * subregion.applyForce(n, theta, coefficient) * * def applyForceOnNodes(self, nodes, theta, coefficient=0): # <<<<<<<<<<<<<< * for n in nodes: * self.applyForce(n, theta, coefficient) */ - __pyx_tuple__19 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_nodes, __pyx_n_s_theta, __pyx_n_s_coefficient); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_tuple__19 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_nodes, __pyx_n_s_theta, __pyx_n_s_coefficient); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); - __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fa2_fa2util_py, __pyx_n_s_applyForceOnNodes, 253, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fa2util_py, __pyx_n_s_applyForceOnNodes, 247, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(2, 247, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ - __pyx_tuple__21 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(2, 1, __pyx_L1_error) + __pyx_tuple__21 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); - __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(2, 1, __pyx_L1_error) + __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":16 * else: @@ -10850,60 +10783,40 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_Region__set_state(self, __pyx_state) */ - __pyx_tuple__23 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(2, 16, __pyx_L1_error) + __pyx_tuple__23 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23); - __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(2, 16, __pyx_L1_error) + __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(1, 16, __pyx_L1_error) - /* "fa2/fa2util.py":259 + /* "fa2/fa2util.py":253 * * # Adjust speed and apply forces step * def adjustSpeedAndApplyForces(nodes, speed, speedEfficiency, jitterTolerance): # <<<<<<<<<<<<<< * # Auto adjust speed. * totalSwinging = 0.0 # How much irregular movement */ - __pyx_tuple__25 = PyTuple_Pack(4, __pyx_n_s_nodes, __pyx_n_s_speed, __pyx_n_s_speedEfficiency, __pyx_n_s_jitterTolerance); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 259, __pyx_L1_error) + __pyx_tuple__25 = PyTuple_Pack(4, __pyx_n_s_nodes, __pyx_n_s_speed, __pyx_n_s_speedEfficiency, __pyx_n_s_jitterTolerance); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(2, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); - __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fa2_fa2util_py, __pyx_n_s_adjustSpeedAndApplyForces, 259, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 259, __pyx_L1_error) - - /* "fa2/fa2util.py":324 - * - * if not cython.compiled: - * print("Warning: uncompiled fa2util module. Compile with cython for a 10-100x speed boost.") # <<<<<<<<<<<<<< - * except: - * print("No cython detected. Install cython and compile the fa2util module for a 10-100x speed boost.") - */ - __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_u_Warning_uncompiled_fa2util_modul); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 324, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__27); - __Pyx_GIVEREF(__pyx_tuple__27); - - /* "fa2/fa2util.py":326 - * print("Warning: uncompiled fa2util module. Compile with cython for a 10-100x speed boost.") - * except: - * print("No cython detected. Install cython and compile the fa2util module for a 10-100x speed boost.") # <<<<<<<<<<<<<< - */ - __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_u_No_cython_detected_Install_cytho); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 326, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__28); - __Pyx_GIVEREF(__pyx_tuple__28); + __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fa2util_py, __pyx_n_s_adjustSpeedAndApplyForces, 253, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(2, 253, __pyx_L1_error) /* "(tree fragment)":1 * def __pyx_unpickle_Node(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ - __pyx_tuple__29 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(2, 1, __pyx_L1_error) + __pyx_tuple__27 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Node, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_tuple__29 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__29); __Pyx_GIVEREF(__pyx_tuple__29); - __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Node, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(2, 1, __pyx_L1_error) - __pyx_tuple__31 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(2, 1, __pyx_L1_error) + __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Edge, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_tuple__31 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); - __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Edge, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(2, 1, __pyx_L1_error) - __pyx_tuple__33 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(2, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__33); - __Pyx_GIVEREF(__pyx_tuple__33); - __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Region, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(2, 1, __pyx_L1_error) + __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Region, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -10912,12 +10825,12 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { } static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - __pyx_float__05 = PyFloat_FromDouble(.05); if (unlikely(!__pyx_float__05)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_float_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_float_1_0)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_49427421 = PyInt_FromLong(49427421L); if (unlikely(!__pyx_int_49427421)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_107934919 = PyInt_FromLong(107934919L); if (unlikely(!__pyx_int_107934919)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_189175108 = PyInt_FromLong(189175108L); if (unlikely(!__pyx_int_189175108)) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(2, 1, __pyx_L1_error); + __pyx_float__05 = PyFloat_FromDouble(.05); if (unlikely(!__pyx_float__05)) __PYX_ERR(2, 1, __pyx_L1_error) + __pyx_float_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_float_1_0)) __PYX_ERR(2, 1, __pyx_L1_error) + __pyx_int_49427421 = PyInt_FromLong(49427421L); if (unlikely(!__pyx_int_49427421)) __PYX_ERR(2, 1, __pyx_L1_error) + __pyx_int_107934919 = PyInt_FromLong(107934919L); if (unlikely(!__pyx_int_107934919)) __PYX_ERR(2, 1, __pyx_L1_error) + __pyx_int_189175108 = PyInt_FromLong(189175108L); if (unlikely(!__pyx_int_189175108)) __PYX_ERR(2, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -10951,15 +10864,15 @@ static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ - if (__Pyx_ExportFunction("linRepulsion", (void (*)(void))__pyx_f_3fa2_7fa2util_linRepulsion, "void (struct __pyx_obj_3fa2_7fa2util_Node *, struct __pyx_obj_3fa2_7fa2util_Node *, struct __pyx_opt_args_3fa2_7fa2util_linRepulsion *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ExportFunction("linRepulsion_region", (void (*)(void))__pyx_f_3fa2_7fa2util_linRepulsion_region, "void (struct __pyx_obj_3fa2_7fa2util_Node *, struct __pyx_obj_3fa2_7fa2util_Region *, struct __pyx_opt_args_3fa2_7fa2util_linRepulsion_region *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ExportFunction("linGravity", (void (*)(void))__pyx_f_3fa2_7fa2util_linGravity, "void (struct __pyx_obj_3fa2_7fa2util_Node *, double)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ExportFunction("strongGravity", (void (*)(void))__pyx_f_3fa2_7fa2util_strongGravity, "void (struct __pyx_obj_3fa2_7fa2util_Node *, double, struct __pyx_opt_args_3fa2_7fa2util_strongGravity *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ExportFunction("linAttraction", (void (*)(void))__pyx_f_3fa2_7fa2util_linAttraction, "void (struct __pyx_obj_3fa2_7fa2util_Node *, struct __pyx_obj_3fa2_7fa2util_Node *, double, int, int __pyx_skip_dispatch, struct __pyx_opt_args_3fa2_7fa2util_linAttraction *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ExportFunction("apply_repulsion", (void (*)(void))__pyx_f_3fa2_7fa2util_apply_repulsion, "void (PyObject *, double, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ExportFunction("apply_gravity", (void (*)(void))__pyx_f_3fa2_7fa2util_apply_gravity, "void (PyObject *, double, double, int __pyx_skip_dispatch, struct __pyx_opt_args_3fa2_7fa2util_apply_gravity *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ExportFunction("apply_attraction", (void (*)(void))__pyx_f_3fa2_7fa2util_apply_attraction, "void (PyObject *, PyObject *, int, double, double, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ExportFunction("adjustSpeedAndApplyForces", (void (*)(void))__pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces, "PyObject *(PyObject *, double, double, double, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("linRepulsion", (void (*)(void))__pyx_f_3fa2_7fa2util_linRepulsion, "void (struct __pyx_obj_3fa2_7fa2util_Node *, struct __pyx_obj_3fa2_7fa2util_Node *, struct __pyx_opt_args_3fa2_7fa2util_linRepulsion *__pyx_optional_args)") < 0) __PYX_ERR(2, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("linRepulsion_region", (void (*)(void))__pyx_f_3fa2_7fa2util_linRepulsion_region, "void (struct __pyx_obj_3fa2_7fa2util_Node *, struct __pyx_obj_3fa2_7fa2util_Region *, struct __pyx_opt_args_3fa2_7fa2util_linRepulsion_region *__pyx_optional_args)") < 0) __PYX_ERR(2, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("linGravity", (void (*)(void))__pyx_f_3fa2_7fa2util_linGravity, "void (struct __pyx_obj_3fa2_7fa2util_Node *, double)") < 0) __PYX_ERR(2, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("strongGravity", (void (*)(void))__pyx_f_3fa2_7fa2util_strongGravity, "void (struct __pyx_obj_3fa2_7fa2util_Node *, double, struct __pyx_opt_args_3fa2_7fa2util_strongGravity *__pyx_optional_args)") < 0) __PYX_ERR(2, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("linAttraction", (void (*)(void))__pyx_f_3fa2_7fa2util_linAttraction, "void (struct __pyx_obj_3fa2_7fa2util_Node *, struct __pyx_obj_3fa2_7fa2util_Node *, double, int, int __pyx_skip_dispatch, struct __pyx_opt_args_3fa2_7fa2util_linAttraction *__pyx_optional_args)") < 0) __PYX_ERR(2, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("apply_repulsion", (void (*)(void))__pyx_f_3fa2_7fa2util_apply_repulsion, "void (PyObject *, double, int __pyx_skip_dispatch)") < 0) __PYX_ERR(2, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("apply_gravity", (void (*)(void))__pyx_f_3fa2_7fa2util_apply_gravity, "void (PyObject *, double, double, int __pyx_skip_dispatch, struct __pyx_opt_args_3fa2_7fa2util_apply_gravity *__pyx_optional_args)") < 0) __PYX_ERR(2, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("apply_attraction", (void (*)(void))__pyx_f_3fa2_7fa2util_apply_attraction, "void (PyObject *, PyObject *, int, double, double, int __pyx_skip_dispatch)") < 0) __PYX_ERR(2, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("adjustSpeedAndApplyForces", (void (*)(void))__pyx_f_3fa2_7fa2util_adjustSpeedAndApplyForces, "PyObject *(PyObject *, double, double, double, int __pyx_skip_dispatch)") < 0) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -10971,41 +10884,41 @@ static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ - if (PyType_Ready(&__pyx_type_3fa2_7fa2util_Node) < 0) __PYX_ERR(0, 17, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_3fa2_7fa2util_Node) < 0) __PYX_ERR(2, 17, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_3fa2_7fa2util_Node.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_3fa2_7fa2util_Node.tp_dictoffset && __pyx_type_3fa2_7fa2util_Node.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_3fa2_7fa2util_Node.tp_getattro = __Pyx_PyObject_GenericGetAttr; } - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Node, (PyObject *)&__pyx_type_3fa2_7fa2util_Node) < 0) __PYX_ERR(0, 17, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_3fa2_7fa2util_Node) < 0) __PYX_ERR(0, 17, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Node, (PyObject *)&__pyx_type_3fa2_7fa2util_Node) < 0) __PYX_ERR(2, 17, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_3fa2_7fa2util_Node) < 0) __PYX_ERR(2, 17, __pyx_L1_error) __pyx_ptype_3fa2_7fa2util_Node = &__pyx_type_3fa2_7fa2util_Node; - if (PyType_Ready(&__pyx_type_3fa2_7fa2util_Edge) < 0) __PYX_ERR(0, 29, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_3fa2_7fa2util_Edge) < 0) __PYX_ERR(2, 29, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_3fa2_7fa2util_Edge.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_3fa2_7fa2util_Edge.tp_dictoffset && __pyx_type_3fa2_7fa2util_Edge.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_3fa2_7fa2util_Edge.tp_getattro = __Pyx_PyObject_GenericGetAttr; } - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Edge, (PyObject *)&__pyx_type_3fa2_7fa2util_Edge) < 0) __PYX_ERR(0, 29, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_3fa2_7fa2util_Edge) < 0) __PYX_ERR(0, 29, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Edge, (PyObject *)&__pyx_type_3fa2_7fa2util_Edge) < 0) __PYX_ERR(2, 29, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_3fa2_7fa2util_Edge) < 0) __PYX_ERR(2, 29, __pyx_L1_error) __pyx_ptype_3fa2_7fa2util_Edge = &__pyx_type_3fa2_7fa2util_Edge; __pyx_vtabptr_3fa2_7fa2util_Region = &__pyx_vtable_3fa2_7fa2util_Region; __pyx_vtable_3fa2_7fa2util_Region.updateMassAndGeometry = (void (*)(struct __pyx_obj_3fa2_7fa2util_Region *))__pyx_f_3fa2_7fa2util_6Region_updateMassAndGeometry; __pyx_vtable_3fa2_7fa2util_Region.buildSubRegions = (void (*)(struct __pyx_obj_3fa2_7fa2util_Region *, int __pyx_skip_dispatch))__pyx_f_3fa2_7fa2util_6Region_buildSubRegions; __pyx_vtable_3fa2_7fa2util_Region.applyForce = (void (*)(struct __pyx_obj_3fa2_7fa2util_Region *, struct __pyx_obj_3fa2_7fa2util_Node *, double, struct __pyx_opt_args_3fa2_7fa2util_6Region_applyForce *__pyx_optional_args))__pyx_f_3fa2_7fa2util_6Region_applyForce; __pyx_vtable_3fa2_7fa2util_Region.applyForceOnNodes = (PyObject *(*)(struct __pyx_obj_3fa2_7fa2util_Region *, PyObject *, double, int __pyx_skip_dispatch, struct __pyx_opt_args_3fa2_7fa2util_6Region_applyForceOnNodes *__pyx_optional_args))__pyx_f_3fa2_7fa2util_6Region_applyForceOnNodes; - if (PyType_Ready(&__pyx_type_3fa2_7fa2util_Region) < 0) __PYX_ERR(0, 149, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_3fa2_7fa2util_Region) < 0) __PYX_ERR(2, 149, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_3fa2_7fa2util_Region.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_3fa2_7fa2util_Region.tp_dictoffset && __pyx_type_3fa2_7fa2util_Region.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_3fa2_7fa2util_Region.tp_getattro = __Pyx_PyObject_GenericGetAttr; } - if (__Pyx_SetVtable(__pyx_type_3fa2_7fa2util_Region.tp_dict, __pyx_vtabptr_3fa2_7fa2util_Region) < 0) __PYX_ERR(0, 149, __pyx_L1_error) - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Region, (PyObject *)&__pyx_type_3fa2_7fa2util_Region) < 0) __PYX_ERR(0, 149, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_3fa2_7fa2util_Region) < 0) __PYX_ERR(0, 149, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_3fa2_7fa2util_Region.tp_dict, __pyx_vtabptr_3fa2_7fa2util_Region) < 0) __PYX_ERR(2, 149, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Region, (PyObject *)&__pyx_type_3fa2_7fa2util_Region) < 0) __PYX_ERR(2, 149, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_3fa2_7fa2util_Region) < 0) __PYX_ERR(2, 149, __pyx_L1_error) __pyx_ptype_3fa2_7fa2util_Region = &__pyx_type_3fa2_7fa2util_Region; __Pyx_RefNannyFinishContext(); return 0; @@ -11137,7 +11050,6 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_fa2util(PyObject *__pyx_pyinit_mod PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { @@ -11158,30 +11070,30 @@ if (!__Pyx_RefNanny) { } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_fa2util(void)", 0); - if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_check_binary_version() < 0) __PYX_ERR(2, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(2, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(2, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(2, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED - if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__pyx_CyFunction_init() < 0) __PYX_ERR(2, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED - if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(2, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED - if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__pyx_Coroutine_init() < 0) __PYX_ERR(2, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED - if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__pyx_Generator_init() < 0) __PYX_ERR(2, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED - if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(2, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED - if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(2, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ @@ -11200,28 +11112,28 @@ if (!__Pyx_RefNanny) { #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + if (unlikely(!__pyx_m)) __PYX_ERR(2, 1, __pyx_L1_error) #endif - __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(2, 1, __pyx_L1_error) Py_INCREF(__pyx_d); - __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(2, 1, __pyx_L1_error) Py_INCREF(__pyx_b); - __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(2, 1, __pyx_L1_error) Py_INCREF(__pyx_cython_runtime); - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(2, 1, __pyx_L1_error); /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitGlobals() < 0) __PYX_ERR(2, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(2, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_fa2__fa2util) { - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(2, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { - PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(2, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "fa2.fa2util")) { - if (unlikely(PyDict_SetItemString(modules, "fa2.fa2util", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + if (unlikely(PyDict_SetItemString(modules, "fa2.fa2util", __pyx_m) < 0)) __PYX_ERR(2, 1, __pyx_L1_error) } } #endif @@ -11239,7 +11151,7 @@ if (!__Pyx_RefNanny) { (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_patch_abc() < 0) __PYX_ERR(2, 1, __pyx_L1_error) #endif /* "fa2/fa2util.py":13 @@ -11249,17 +11161,17 @@ if (!__Pyx_RefNanny) { * * */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_sqrt); __Pyx_GIVEREF(__pyx_n_s_sqrt); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_sqrt); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_math, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error) + __pyx_t_2 = __Pyx_Import(__pyx_n_s_math, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error) + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_sqrt, __pyx_t_1) < 0) __PYX_ERR(0, 13, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sqrt, __pyx_t_1) < 0) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -11268,9 +11180,9 @@ if (!__Pyx_RefNanny) { * cdef tuple state * cdef object _dict */ - __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3fa2_7fa2util_4Node_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Node___reduce_cython, NULL, __pyx_n_s_fa2_fa2util, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3fa2_7fa2util_4Node_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Node___reduce_cython, NULL, __pyx_n_s_fa2_fa2util, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(2, 1, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":16 @@ -11279,9 +11191,9 @@ if (!__Pyx_RefNanny) { * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_Node__set_state(self, __pyx_state) */ - __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3fa2_7fa2util_4Node_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Node___setstate_cython, NULL, __pyx_n_s_fa2_fa2util, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 16, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3fa2_7fa2util_4Node_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Node___setstate_cython, NULL, __pyx_n_s_fa2_fa2util, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(2, 16, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 @@ -11289,9 +11201,9 @@ if (!__Pyx_RefNanny) { * cdef tuple state * cdef object _dict */ - __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3fa2_7fa2util_4Edge_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Edge___reduce_cython, NULL, __pyx_n_s_fa2_fa2util, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3fa2_7fa2util_4Edge_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Edge___reduce_cython, NULL, __pyx_n_s_fa2_fa2util, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(2, 1, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":16 @@ -11300,9 +11212,9 @@ if (!__Pyx_RefNanny) { * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_Edge__set_state(self, __pyx_state) */ - __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3fa2_7fa2util_4Edge_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Edge___setstate_cython, NULL, __pyx_n_s_fa2_fa2util, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 16, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3fa2_7fa2util_4Edge_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Edge___setstate_cython, NULL, __pyx_n_s_fa2_fa2util, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(2, 16, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "fa2/fa2util.py":97 @@ -11312,9 +11224,9 @@ if (!__Pyx_RefNanny) { * xDist = n1.x - n2.x * yDist = n1.y - n2.y */ - __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3fa2_7fa2util_1linAttraction, 0, __pyx_n_s_linAttraction, NULL, __pyx_n_s_fa2_fa2util, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3fa2_7fa2util_1linAttraction, 0, __pyx_n_s_linAttraction, NULL, __pyx_n_s_fa2_fa2util, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_linAttraction, __pyx_t_2) < 0) __PYX_ERR(0, 97, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_linAttraction, __pyx_t_2) < 0) __PYX_ERR(2, 97, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "fa2/fa2util.py":113 @@ -11324,9 +11236,9 @@ if (!__Pyx_RefNanny) { * i = 0 * for n1 in nodes: */ - __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3fa2_7fa2util_3apply_repulsion, 0, __pyx_n_s_apply_repulsion, NULL, __pyx_n_s_fa2_fa2util, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3fa2_7fa2util_3apply_repulsion, 0, __pyx_n_s_apply_repulsion, NULL, __pyx_n_s_fa2_fa2util, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_apply_repulsion, __pyx_t_2) < 0) __PYX_ERR(0, 113, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_apply_repulsion, __pyx_t_2) < 0) __PYX_ERR(2, 113, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "fa2/fa2util.py":125 @@ -11336,9 +11248,9 @@ if (!__Pyx_RefNanny) { * if not useStrongGravity: * for n in nodes: */ - __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3fa2_7fa2util_5apply_gravity, 0, __pyx_n_s_apply_gravity, NULL, __pyx_n_s_fa2_fa2util, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3fa2_7fa2util_5apply_gravity, 0, __pyx_n_s_apply_gravity, NULL, __pyx_n_s_fa2_fa2util, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_apply_gravity, __pyx_t_2) < 0) __PYX_ERR(0, 125, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_apply_gravity, __pyx_t_2) < 0) __PYX_ERR(2, 125, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "fa2/fa2util.py":134 @@ -11348,9 +11260,9 @@ if (!__Pyx_RefNanny) { * # Optimization, since usually edgeWeightInfluence is 0 or 1, and pow is slow * if edgeWeightInfluence == 0: */ - __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3fa2_7fa2util_7apply_attraction, 0, __pyx_n_s_apply_attraction, NULL, __pyx_n_s_fa2_fa2util, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 134, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3fa2_7fa2util_7apply_attraction, 0, __pyx_n_s_apply_attraction, NULL, __pyx_n_s_fa2_fa2util, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_apply_attraction, __pyx_t_2) < 0) __PYX_ERR(0, 134, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_apply_attraction, __pyx_t_2) < 0) __PYX_ERR(2, 134, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "fa2/fa2util.py":176 @@ -11358,24 +11270,24 @@ if (!__Pyx_RefNanny) { * * def buildSubRegions(self): # <<<<<<<<<<<<<< * if len(self.nodes) > 1: - * + * topleftNodes = [] */ - __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3fa2_7fa2util_6Region_3buildSubRegions, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Region_buildSubRegions, NULL, __pyx_n_s_fa2_fa2util, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 176, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3fa2_7fa2util_6Region_3buildSubRegions, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Region_buildSubRegions, NULL, __pyx_n_s_fa2_fa2util, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem((PyObject *)__pyx_ptype_3fa2_7fa2util_Region->tp_dict, __pyx_n_s_buildSubRegions, __pyx_t_2) < 0) __PYX_ERR(0, 176, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_ptype_3fa2_7fa2util_Region->tp_dict, __pyx_n_s_buildSubRegions, __pyx_t_2) < 0) __PYX_ERR(2, 176, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_3fa2_7fa2util_Region); - /* "fa2/fa2util.py":253 + /* "fa2/fa2util.py":247 * subregion.applyForce(n, theta, coefficient) * * def applyForceOnNodes(self, nodes, theta, coefficient=0): # <<<<<<<<<<<<<< * for n in nodes: * self.applyForce(n, theta, coefficient) */ - __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3fa2_7fa2util_6Region_5applyForceOnNodes, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Region_applyForceOnNodes, NULL, __pyx_n_s_fa2_fa2util, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3fa2_7fa2util_6Region_5applyForceOnNodes, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Region_applyForceOnNodes, NULL, __pyx_n_s_fa2_fa2util, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem((PyObject *)__pyx_ptype_3fa2_7fa2util_Region->tp_dict, __pyx_n_s_applyForceOnNodes, __pyx_t_2) < 0) __PYX_ERR(0, 253, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_ptype_3fa2_7fa2util_Region->tp_dict, __pyx_n_s_applyForceOnNodes, __pyx_t_2) < 0) __PYX_ERR(2, 247, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_3fa2_7fa2util_Region); @@ -11384,9 +11296,9 @@ if (!__Pyx_RefNanny) { * cdef tuple state * cdef object _dict */ - __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3fa2_7fa2util_6Region_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Region___reduce_cython, NULL, __pyx_n_s_fa2_fa2util, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3fa2_7fa2util_6Region_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Region___reduce_cython, NULL, __pyx_n_s_fa2_fa2util, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(2, 1, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":16 @@ -11395,24 +11307,24 @@ if (!__Pyx_RefNanny) { * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_Region__set_state(self, __pyx_state) */ - __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3fa2_7fa2util_6Region_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Region___setstate_cython, NULL, __pyx_n_s_fa2_fa2util, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 16, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3fa2_7fa2util_6Region_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Region___setstate_cython, NULL, __pyx_n_s_fa2_fa2util, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(2, 16, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "fa2/fa2util.py":259 + /* "fa2/fa2util.py":253 * * # Adjust speed and apply forces step * def adjustSpeedAndApplyForces(nodes, speed, speedEfficiency, jitterTolerance): # <<<<<<<<<<<<<< * # Auto adjust speed. * totalSwinging = 0.0 # How much irregular movement */ - __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3fa2_7fa2util_9adjustSpeedAndApplyForces, 0, __pyx_n_s_adjustSpeedAndApplyForces, NULL, __pyx_n_s_fa2_fa2util, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3fa2_7fa2util_9adjustSpeedAndApplyForces, 0, __pyx_n_s_adjustSpeedAndApplyForces, NULL, __pyx_n_s_fa2_fa2util, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_adjustSpeedAndApplyForces, __pyx_t_2) < 0) __PYX_ERR(0, 259, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_adjustSpeedAndApplyForces, __pyx_t_2) < 0) __PYX_ERR(2, 253, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "fa2/fa2util.py":320 + /* "fa2/fa2util.py":314 * * * try: # <<<<<<<<<<<<<< @@ -11428,7 +11340,7 @@ if (!__Pyx_RefNanny) { __Pyx_XGOTREF(__pyx_t_5); /*try:*/ { - /* "fa2/fa2util.py":323 + /* "fa2/fa2util.py":317 * import cython * * if not cython.compiled: # <<<<<<<<<<<<<< @@ -11438,18 +11350,16 @@ if (!__Pyx_RefNanny) { __pyx_t_6 = ((!(1 != 0)) != 0); if (__pyx_t_6) { - /* "fa2/fa2util.py":324 + /* "fa2/fa2util.py":318 * * if not cython.compiled: * print("Warning: uncompiled fa2util module. Compile with cython for a 10-100x speed boost.") # <<<<<<<<<<<<<< * except: * print("No cython detected. Install cython and compile the fa2util module for a 10-100x speed boost.") */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 324, __pyx_L2_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PrintOne(0, __pyx_kp_s_Warning_uncompiled_fa2util_modul) < 0) __PYX_ERR(2, 318, __pyx_L2_error) - /* "fa2/fa2util.py":323 + /* "fa2/fa2util.py":317 * import cython * * if not cython.compiled: # <<<<<<<<<<<<<< @@ -11458,7 +11368,7 @@ if (!__Pyx_RefNanny) { */ } - /* "fa2/fa2util.py":320 + /* "fa2/fa2util.py":314 * * * try: # <<<<<<<<<<<<<< @@ -11474,7 +11384,7 @@ if (!__Pyx_RefNanny) { __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "fa2/fa2util.py":325 + /* "fa2/fa2util.py":319 * if not cython.compiled: * print("Warning: uncompiled fa2util module. Compile with cython for a 10-100x speed boost.") * except: # <<<<<<<<<<<<<< @@ -11482,19 +11392,17 @@ if (!__Pyx_RefNanny) { */ /*except:*/ { __Pyx_AddTraceback("fa2.fa2util", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_7) < 0) __PYX_ERR(0, 325, __pyx_L4_except_error) + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_7) < 0) __PYX_ERR(2, 319, __pyx_L4_except_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_7); - /* "fa2/fa2util.py":326 + /* "fa2/fa2util.py":320 * print("Warning: uncompiled fa2util module. Compile with cython for a 10-100x speed boost.") * except: * print("No cython detected. Install cython and compile the fa2util module for a 10-100x speed boost.") # <<<<<<<<<<<<<< */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 326, __pyx_L4_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_PrintOne(0, __pyx_kp_s_No_cython_detected_Install_cytho) < 0) __PYX_ERR(2, 320, __pyx_L4_except_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -11502,7 +11410,7 @@ if (!__Pyx_RefNanny) { } __pyx_L4_except_error:; - /* "fa2/fa2util.py":320 + /* "fa2/fa2util.py":314 * * * try: # <<<<<<<<<<<<<< @@ -11527,9 +11435,9 @@ if (!__Pyx_RefNanny) { * cdef object __pyx_PickleError * cdef object __pyx_result */ - __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3fa2_7fa2util_11__pyx_unpickle_Node, 0, __pyx_n_s_pyx_unpickle_Node, NULL, __pyx_n_s_fa2_fa2util, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 1, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3fa2_7fa2util_11__pyx_unpickle_Node, 0, __pyx_n_s_pyx_unpickle_Node, NULL, __pyx_n_s_fa2_fa2util, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Node, __pyx_t_7) < 0) __PYX_ERR(2, 1, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Node, __pyx_t_7) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "(tree fragment)":11 @@ -11539,9 +11447,9 @@ if (!__Pyx_RefNanny) { * __pyx_result.dx = __pyx_state[0]; __pyx_result.dy = __pyx_state[1]; __pyx_result.mass = __pyx_state[2]; __pyx_result.old_dx = __pyx_state[3]; __pyx_result.old_dy = __pyx_state[4]; __pyx_result.x = __pyx_state[5]; __pyx_result.y = __pyx_state[6] * if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'): */ - __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3fa2_7fa2util_13__pyx_unpickle_Edge, 0, __pyx_n_s_pyx_unpickle_Edge, NULL, __pyx_n_s_fa2_fa2util, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 1, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3fa2_7fa2util_13__pyx_unpickle_Edge, 0, __pyx_n_s_pyx_unpickle_Edge, NULL, __pyx_n_s_fa2_fa2util, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Edge, __pyx_t_7) < 0) __PYX_ERR(2, 1, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Edge, __pyx_t_7) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "(tree fragment)":1 @@ -11549,9 +11457,9 @@ if (!__Pyx_RefNanny) { * cdef object __pyx_PickleError * cdef object __pyx_result */ - __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3fa2_7fa2util_15__pyx_unpickle_Region, 0, __pyx_n_s_pyx_unpickle_Region, NULL, __pyx_n_s_fa2_fa2util, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 1, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3fa2_7fa2util_15__pyx_unpickle_Region, 0, __pyx_n_s_pyx_unpickle_Region, NULL, __pyx_n_s_fa2_fa2util, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Region, __pyx_t_7) < 0) __PYX_ERR(2, 1, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Region, __pyx_t_7) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "fa2/fa2util.py":1 @@ -11559,9 +11467,9 @@ if (!__Pyx_RefNanny) { * # main code. This allows them to be optimized with Cython. If you * # don't have Cython, this will run normally. However, if you use */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_7) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_7) < 0) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /*--- Wrapped vars code ---*/ @@ -11571,7 +11479,6 @@ if (!__Pyx_RefNanny) { __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init fa2.fa2util", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -11609,34 +11516,6 @@ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { } #endif -/* PyObjectGetAttrStr */ -#if CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_getattro)) - return tp->tp_getattro(obj, attr_name); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_getattr)) - return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); -#endif - return PyObject_GetAttr(obj, attr_name); -} -#endif - -/* GetBuiltinName */ -static PyObject *__Pyx_GetBuiltinName(PyObject *name) { - PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); - if (unlikely(!result)) { - PyErr_Format(PyExc_NameError, -#if PY_MAJOR_VERSION >= 3 - "name '%U' is not defined", name); -#else - "name '%.200s' is not defined", PyString_AS_STRING(name)); -#endif - } - return result; -} - /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, @@ -11752,6 +11631,20 @@ static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject } #endif +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + /* GetAttr */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { #if CYTHON_USE_TYPE_SLOTS @@ -11780,6 +11673,20 @@ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject return (likely(r)) ? r : __Pyx_GetAttr3Default(d); } +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { @@ -12843,43 +12750,43 @@ static int __Pyx_setup_reduce(PyObject* type_obj) { PyObject *setstate = NULL; PyObject *setstate_cython = NULL; #if CYTHON_USE_PYTYPE_LOOKUP - if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD; + if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD; #else - if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD; + if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD; #endif #if CYTHON_USE_PYTYPE_LOOKUP - object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD; + object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #else - object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD; + object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #endif - reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD; + reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; if (reduce_ex == object_reduce_ex) { #if CYTHON_USE_PYTYPE_LOOKUP - object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD; + object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #else - object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD; + object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #endif - reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD; + reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { - reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD; - ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD; - ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD; + reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto __PYX_BAD; + ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate); if (!setstate) PyErr_Clear(); if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { - setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD; - ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD; - ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD; + setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto __PYX_BAD; + ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } PyType_Modified((PyTypeObject*)type_obj); } } - goto GOOD; -BAD: + goto __PYX_GOOD; +__PYX_BAD: if (!PyErr_Occurred()) PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name); ret = -1; -GOOD: +__PYX_GOOD: #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); @@ -13515,6 +13422,9 @@ static PyTypeObject __pyx_CyFunctionType_type = { #if PY_VERSION_HEX >= 0x030800b1 0, #endif +#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, +#endif }; static int __pyx_CyFunction_init(void) { __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); @@ -13938,6 +13848,112 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, return (target_type) value;\ } +/* Print */ + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 +static PyObject *__Pyx_GetStdout(void) { + PyObject *f = PySys_GetObject((char *)"stdout"); + if (!f) { + PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout"); + } + return f; +} +static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) { + int i; + if (!f) { + if (!(f = __Pyx_GetStdout())) + return -1; + } + Py_INCREF(f); + for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) { + PyObject* v; + if (PyFile_SoftSpace(f, 1)) { + if (PyFile_WriteString(" ", f) < 0) + goto error; + } + v = PyTuple_GET_ITEM(arg_tuple, i); + if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0) + goto error; + if (PyString_Check(v)) { + char *s = PyString_AsString(v); + Py_ssize_t len = PyString_Size(v); + if (len > 0) { + switch (s[len-1]) { + case ' ': break; + case '\f': case '\r': case '\n': case '\t': case '\v': + PyFile_SoftSpace(f, 0); + break; + default: break; + } + } + } + } + if (newline) { + if (PyFile_WriteString("\n", f) < 0) + goto error; + PyFile_SoftSpace(f, 0); + } + Py_DECREF(f); + return 0; +error: + Py_DECREF(f); + return -1; +} +#else +static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) { + PyObject* kwargs = 0; + PyObject* result = 0; + PyObject* end_string; + if (unlikely(!__pyx_print)) { + __pyx_print = PyObject_GetAttr(__pyx_b, __pyx_n_s_print); + if (!__pyx_print) + return -1; + } + if (stream) { + kwargs = PyDict_New(); + if (unlikely(!kwargs)) + return -1; + if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0)) + goto bad; + if (!newline) { + end_string = PyUnicode_FromStringAndSize(" ", 1); + if (unlikely(!end_string)) + goto bad; + if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) { + Py_DECREF(end_string); + goto bad; + } + Py_DECREF(end_string); + } + } else if (!newline) { + if (unlikely(!__pyx_print_kwargs)) { + __pyx_print_kwargs = PyDict_New(); + if (unlikely(!__pyx_print_kwargs)) + return -1; + end_string = PyUnicode_FromStringAndSize(" ", 1); + if (unlikely(!end_string)) + return -1; + if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) { + Py_DECREF(end_string); + return -1; + } + Py_DECREF(end_string); + } + kwargs = __pyx_print_kwargs; + } + result = PyObject_Call(__pyx_print, arg_tuple, kwargs); + if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs)) + Py_DECREF(kwargs); + if (!result) + return -1; + Py_DECREF(result); + return 0; +bad: + if (kwargs != __pyx_print_kwargs) + Py_XDECREF(kwargs); + return -1; +} +#endif + /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; @@ -14158,6 +14174,43 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, return (int) -1; } +/* PrintOne */ + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 +static int __Pyx_PrintOne(PyObject* f, PyObject *o) { + if (!f) { + if (!(f = __Pyx_GetStdout())) + return -1; + } + Py_INCREF(f); + if (PyFile_SoftSpace(f, 0)) { + if (PyFile_WriteString(" ", f) < 0) + goto error; + } + if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0) + goto error; + if (PyFile_WriteString("\n", f) < 0) + goto error; + Py_DECREF(f); + return 0; +error: + Py_DECREF(f); + return -1; + /* the line below is just to avoid C compiler + * warnings about unused functions */ + return __Pyx_Print(f, NULL, 0); +} +#else +static int __Pyx_PrintOne(PyObject* stream, PyObject *o) { + int res; + PyObject* arg_tuple = PyTuple_Pack(1, o); + if (unlikely(!arg_tuple)) + return -1; + res = __Pyx_Print(stream, arg_tuple, 1); + Py_DECREF(arg_tuple); + return res; +} +#endif + /* 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/fa2/fa2util.pxd b/fa2/fa2util.pxd index adaf628..ff43384 100644 --- a/fa2/fa2util.pxd +++ b/fa2/fa2util.pxd @@ -87,8 +87,6 @@ cdef class Region: cdef void updateMassAndGeometry(self) @cython.locals(n = Node, - leftNodes = list, - rightNodes = list, topleftNodes = list, bottomleftNodes = list, toprightNodes = list, diff --git a/fa2/fa2util.py b/fa2/fa2util.py index 0fcfeae..a1fadfc 100644 --- a/fa2/fa2util.py +++ b/fa2/fa2util.py @@ -175,30 +175,24 @@ def updateMassAndGeometry(self): def buildSubRegions(self): if len(self.nodes) > 1: - - leftNodes = [] - rightNodes = [] - for n in self.nodes: - if n.x < self.massCenterX: - leftNodes.append(n) - else: - rightNodes.append(n) - topleftNodes = [] bottomleftNodes = [] - for n in leftNodes: - if n.y < self.massCenterY: - topleftNodes.append(n) - else: - bottomleftNodes.append(n) - toprightNodes = [] bottomrightNodes = [] - for n in rightNodes: - if n.y < self.massCenterY: - toprightNodes.append(n) + # Optimization: The distribution of self.nodes into + # subregions now requires only one for loop. Removed + # topNodes and bottomNodes arrays: memory space saving. + for n in self.nodes: + if n.x < self.massCenterX: + if n.y < self.massCenterY: + bottomleftNodes.append(n) + else: + topleftNodes.append(n) else: - bottomrightNodes.append(n) + if n.y < self.massCenterY: + bottomrightNodes.append(n) + else: + toprightNodes.append(n) if len(topleftNodes) > 0: if len(topleftNodes) < len(self.nodes):