From b4d3519f4e536319b883c0411c2929eb327176d9 Mon Sep 17 00:00:00 2001 From: David Doty Date: Sat, 3 Jul 2021 16:49:26 -0700 Subject: [PATCH 1/2] updated README table of contents with CRN link --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 625b7fe..b4af652 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ The core of the simulator uses a [batching algorithm](https://arxiv.org/abs/2005 * [First example protocol](#first-example-protocol) * [Larger state protocol](#larger-state-protocol) * [Protocol with Multiple Fields](#protocol-with-multiple-fields) +* [Simulating Chemical Reaction Networks (CRNs)](#simulating-chemical-reaction-networks-crns) ## Installation From e2c3e689b7d2bebc7418b550f5f9c9c0370542ec Mon Sep 17 00:00:00 2001 From: EricESeverson <68571919+EricESeverson@users.noreply.github.com> Date: Sat, 10 Jul 2021 17:27:32 -0700 Subject: [PATCH 2/2] Update TimeUpdate The TimeUpdate snapshot now uses a tqdm progress bar, which allows it to work on Colab and provides more information. --- ppsim/__version__.py | 2 +- ppsim/simulation.py | 8 +- ppsim/simulator.c | 222 ++++++++++++++++++++++--------------------- ppsim/snapshot.py | 10 +- requirements.txt | 2 +- 5 files changed, 129 insertions(+), 115 deletions(-) diff --git a/ppsim/__version__.py b/ppsim/__version__.py index 90caef9..b9699df 100644 --- a/ppsim/__version__.py +++ b/ppsim/__version__.py @@ -1 +1 @@ -version = '0.1.3' # version line; WARNING: do not remove or change this line or comment +version = '0.1.5' # version line; WARNING: do not remove or change this line or comment diff --git a/ppsim/simulation.py b/ppsim/simulation.py index 8fb6c35..b230888 100644 --- a/ppsim/simulation.py +++ b/ppsim/simulation.py @@ -411,7 +411,10 @@ def run(self, run_until: Union[float, ConvergenceDetector] = None, Defaults to True. """ if len(self.snapshots) == 0 and timer is True: - self.add_snapshot(TimeUpdate()) + if type(run_until) is float or type(run_until) is int: + self.add_snapshot(TimeUpdate(time_bound=run_until)) + else: + self.add_snapshot(TimeUpdate()) end_time = None # stop_condition() returns True when it is time to stop @@ -499,8 +502,9 @@ def get_next_time(): snapshot.update() if len(self.snapshots) == 1 and type(self.snapshots[0]) is TimeUpdate: + self.snapshots[0].pbar.close() self.snapshots.pop() - print() + # print() @property def reactions(self) -> str: diff --git a/ppsim/simulator.c b/ppsim/simulator.c index e7502c0..02c841a 100644 --- a/ppsim/simulator.c +++ b/ppsim/simulator.c @@ -1,25 +1,25 @@ -/* Generated by Cython 0.29.22 */ +/* Generated by Cython 0.29.23 */ /* BEGIN: Cython Metadata { "distutils": { "depends": [ - "C:\\Users\\Eric\\Anaconda2\\lib\\site-packages\\numpy\\core\\include\\numpy\\arrayobject.h", - "C:\\Users\\Eric\\Anaconda2\\lib\\site-packages\\numpy\\core\\include\\numpy\\arrayscalars.h", - "C:\\Users\\Eric\\Anaconda2\\lib\\site-packages\\numpy\\core\\include\\numpy\\ndarrayobject.h", - "C:\\Users\\Eric\\Anaconda2\\lib\\site-packages\\numpy\\core\\include\\numpy\\ndarraytypes.h", - "C:\\Users\\Eric\\Anaconda2\\lib\\site-packages\\numpy\\core\\include\\numpy\\random\\bitgen.h", - "C:\\Users\\Eric\\Anaconda2\\lib\\site-packages\\numpy\\core\\include\\numpy\\random\\distributions.h", - "C:\\Users\\Eric\\Anaconda2\\lib\\site-packages\\numpy\\core\\include\\numpy\\ufuncobject.h" + "C:\\Users\\Eric\\Anaconda2\\envs\\py39\\lib\\site-packages\\numpy\\core\\include\\numpy\\arrayobject.h", + "C:\\Users\\Eric\\Anaconda2\\envs\\py39\\lib\\site-packages\\numpy\\core\\include\\numpy\\arrayscalars.h", + "C:\\Users\\Eric\\Anaconda2\\envs\\py39\\lib\\site-packages\\numpy\\core\\include\\numpy\\ndarrayobject.h", + "C:\\Users\\Eric\\Anaconda2\\envs\\py39\\lib\\site-packages\\numpy\\core\\include\\numpy\\ndarraytypes.h", + "C:\\Users\\Eric\\Anaconda2\\envs\\py39\\lib\\site-packages\\numpy\\core\\include\\numpy\\random\\bitgen.h", + "C:\\Users\\Eric\\Anaconda2\\envs\\py39\\lib\\site-packages\\numpy\\core\\include\\numpy\\random\\distributions.h", + "C:\\Users\\Eric\\Anaconda2\\envs\\py39\\lib\\site-packages\\numpy\\core\\include\\numpy\\ufuncobject.h" ], "include_dirs": [ - "C:\\Users\\Eric\\Anaconda2\\lib\\site-packages\\numpy\\core\\include" + "C:\\Users\\Eric\\Anaconda2\\envs\\py39\\lib\\site-packages\\numpy\\core\\include" ], "libraries": [ "npyrandom" ], "library_dirs": [ - "C:\\Users\\Eric\\Anaconda2\\lib\\site-packages\\numpy\\core\\include\\..\\..\\random\\lib" + "C:\\Users\\Eric\\Anaconda2\\envs\\py39\\lib\\site-packages\\numpy\\core\\include\\..\\..\\random\\lib" ], "name": "ppsim.simulator", "sources": [ @@ -30,15 +30,17 @@ } END: Cython Metadata */ +#ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN +#endif /* PY_SSIZE_T_CLEAN */ #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 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_22" -#define CYTHON_HEX_VERSION 0x001D16F0 +#define CYTHON_ABI "0_29_23" +#define CYTHON_HEX_VERSION 0x001D17F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof @@ -997,7 +999,7 @@ typedef struct { } __Pyx_BufFmt_Context; -/* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":690 +/* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":690 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< @@ -1006,7 +1008,7 @@ typedef struct { */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":691 +/* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":691 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< @@ -1015,7 +1017,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":692 +/* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":692 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -1024,7 +1026,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":693 +/* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":693 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -1033,7 +1035,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":697 +/* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":697 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< @@ -1042,7 +1044,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":698 +/* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":698 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< @@ -1051,7 +1053,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":699 +/* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":699 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -1060,7 +1062,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":700 +/* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":700 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -1069,7 +1071,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":704 +/* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":704 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< @@ -1078,7 +1080,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":705 +/* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":705 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< @@ -1087,7 +1089,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":714 +/* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":714 * # The int types are mapped a bit surprising -- * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t # <<<<<<<<<<<<<< @@ -1096,7 +1098,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t; */ typedef npy_long __pyx_t_5numpy_int_t; -/* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":715 +/* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":715 * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< @@ -1105,7 +1107,7 @@ typedef npy_long __pyx_t_5numpy_int_t; */ typedef npy_longlong __pyx_t_5numpy_long_t; -/* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":716 +/* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":716 * ctypedef npy_long int_t * ctypedef npy_longlong long_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< @@ -1114,7 +1116,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t; */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":718 +/* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":718 * ctypedef npy_longlong longlong_t * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< @@ -1123,7 +1125,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":719 +/* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":719 * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< @@ -1132,7 +1134,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; -/* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":720 +/* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":720 * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< @@ -1141,7 +1143,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":722 +/* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":722 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< @@ -1150,7 +1152,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":723 +/* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":723 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< @@ -1159,7 +1161,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":725 +/* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":725 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< @@ -1168,7 +1170,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":726 +/* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":726 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< @@ -1177,7 +1179,7 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":727 +/* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":727 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< @@ -1223,7 +1225,7 @@ struct __pyx_MemviewEnum_obj; struct __pyx_memoryview_obj; struct __pyx_memoryviewslice_obj; -/* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":729 +/* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":729 * ctypedef npy_longdouble longdouble_t * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< @@ -1232,7 +1234,7 @@ struct __pyx_memoryviewslice_obj; */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; -/* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":730 +/* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":730 * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< @@ -1241,7 +1243,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":731 +/* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":731 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< @@ -1250,7 +1252,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":733 +/* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":733 * ctypedef npy_clongdouble clongdouble_t * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< @@ -12246,7 +12248,7 @@ static PyObject *__pyx_pf_5ppsim_9simulator_3Urn_2__setstate_cython__(CYTHON_UNU return __pyx_r; } -/* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":735 +/* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":735 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -12263,7 +12265,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":736 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":736 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -12277,7 +12279,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":735 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":735 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -12296,7 +12298,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":738 +/* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":738 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -12313,7 +12315,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":739 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":739 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -12327,7 +12329,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":738 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":738 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -12346,7 +12348,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":741 +/* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":741 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -12363,7 +12365,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":742 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":742 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -12377,7 +12379,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":741 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":741 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -12396,7 +12398,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":744 +/* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":744 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -12413,7 +12415,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":745 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":745 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -12427,7 +12429,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":744 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":744 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -12446,7 +12448,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":747 +/* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":747 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -12463,7 +12465,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":748 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":748 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -12477,7 +12479,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":747 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":747 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -12496,7 +12498,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":750 +/* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":750 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -12510,7 +12512,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ int __pyx_t_1; __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0); - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":751 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":751 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -12520,7 +12522,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0); if (__pyx_t_1) { - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":752 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":752 * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): * return d.subarray.shape # <<<<<<<<<<<<<< @@ -12532,7 +12534,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); goto __pyx_L0; - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":751 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":751 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -12541,7 +12543,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ */ } - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":754 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":754 * return d.subarray.shape * else: * return () # <<<<<<<<<<<<<< @@ -12555,7 +12557,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ goto __pyx_L0; } - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":750 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":750 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -12570,7 +12572,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ return __pyx_r; } -/* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":931 +/* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":931 * int _import_umath() except -1 * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -12582,7 +12584,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_array_base", 0); - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":932 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":932 * * cdef inline void set_array_base(ndarray arr, object base): * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<< @@ -12591,7 +12593,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_INCREF(__pyx_v_base); - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":933 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":933 * cdef inline void set_array_base(ndarray arr, object base): * Py_INCREF(base) # important to do this before stealing the reference below! * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<< @@ -12600,7 +12602,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base)); - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":931 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":931 * int _import_umath() except -1 * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -12612,7 +12614,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":935 +/* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":935 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -12627,7 +12629,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 0); - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":936 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":936 * * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) # <<<<<<<<<<<<<< @@ -12636,7 +12638,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ __pyx_v_base = PyArray_BASE(__pyx_v_arr); - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":937 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":937 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -12646,7 +12648,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = ((__pyx_v_base == NULL) != 0); if (__pyx_t_1) { - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":938 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":938 * base = PyArray_BASE(arr) * if base is NULL: * return None # <<<<<<<<<<<<<< @@ -12657,7 +12659,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":937 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":937 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -12666,7 +12668,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ } - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":939 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":939 * if base is NULL: * return None * return base # <<<<<<<<<<<<<< @@ -12678,7 +12680,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = ((PyObject *)__pyx_v_base); goto __pyx_L0; - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":935 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":935 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -12693,7 +12695,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py return __pyx_r; } -/* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":943 +/* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":943 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -12717,7 +12719,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_array", 0); - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":944 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":944 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -12733,7 +12735,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":945 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":945 * cdef inline int import_array() except -1: * try: * __pyx_import_array() # <<<<<<<<<<<<<< @@ -12742,7 +12744,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { */ __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 945, __pyx_L3_error) - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":944 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":944 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -12756,7 +12758,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":946 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":946 * try: * __pyx_import_array() * except Exception: # <<<<<<<<<<<<<< @@ -12771,7 +12773,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":947 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":947 * __pyx_import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< @@ -12787,7 +12789,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":944 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":944 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -12802,7 +12804,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_L8_try_end:; } - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":943 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":943 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -12825,7 +12827,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { return __pyx_r; } -/* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":949 +/* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":949 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -12849,7 +12851,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_umath", 0); - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":950 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":950 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -12865,7 +12867,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":951 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":951 * cdef inline int import_umath() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -12874,7 +12876,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { */ __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 951, __pyx_L3_error) - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":950 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":950 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -12888,7 +12890,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":952 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":952 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -12903,7 +12905,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":953 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":953 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -12919,7 +12921,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":950 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":950 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -12934,7 +12936,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_L8_try_end:; } - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":949 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":949 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -12957,7 +12959,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { return __pyx_r; } -/* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":955 +/* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":955 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -12981,7 +12983,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_ufunc", 0); - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":956 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":956 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -12997,7 +12999,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":957 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":957 * cdef inline int import_ufunc() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -13006,7 +13008,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { */ __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 957, __pyx_L3_error) - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":956 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":956 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -13020,7 +13022,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":958 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":958 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -13035,7 +13037,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":959 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":959 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -13051,7 +13053,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":956 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":956 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -13066,7 +13068,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_L8_try_end:; } - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":955 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":955 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -13089,7 +13091,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { return __pyx_r; } -/* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":969 +/* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":969 * * * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< @@ -13102,7 +13104,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_timedelta64_object", 0); - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":981 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":981 * bool * """ * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<< @@ -13112,7 +13114,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type)); goto __pyx_L0; - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":969 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":969 * * * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< @@ -13126,7 +13128,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ return __pyx_r; } -/* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":984 +/* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":984 * * * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< @@ -13139,7 +13141,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_datetime64_object", 0); - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":996 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":996 * bool * """ * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<< @@ -13149,7 +13151,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type)); goto __pyx_L0; - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":984 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":984 * * * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< @@ -13163,7 +13165,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o return __pyx_r; } -/* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":999 +/* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":999 * * * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -13174,7 +13176,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) { npy_datetime __pyx_r; - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":1006 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":1006 * also needed. That can be found using `get_datetime64_unit`. * """ * return (obj).obval # <<<<<<<<<<<<<< @@ -13184,7 +13186,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":999 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":999 * * * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -13197,7 +13199,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * return __pyx_r; } -/* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":1009 +/* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":1009 * * * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -13208,7 +13210,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) { npy_timedelta __pyx_r; - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":1013 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":1013 * returns the int64 value underlying scalar numpy timedelta64 object * """ * return (obj).obval # <<<<<<<<<<<<<< @@ -13218,7 +13220,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":1009 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":1009 * * * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -13231,7 +13233,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject return __pyx_r; } -/* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":1016 +/* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":1016 * * * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< @@ -13242,7 +13244,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) { NPY_DATETIMEUNIT __pyx_r; - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":1020 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":1020 * returns the unit part of the dtype for a numpy datetime64 object. * """ * return (obj).obmeta.base # <<<<<<<<<<<<<< @@ -13250,7 +13252,7 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base); goto __pyx_L0; - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":1016 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":1016 * * * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< @@ -27986,7 +27988,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":947 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":947 * __pyx_import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< @@ -27997,7 +27999,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); - /* "../../Anaconda2/lib/site-packages/numpy/__init__.pxd":953 + /* "../../Anaconda2/envs/py39/lib/site-packages/numpy/__init__.pxd":953 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< diff --git a/ppsim/snapshot.py b/ppsim/snapshot.py index 0bfc46f..ce73882 100644 --- a/ppsim/snapshot.py +++ b/ppsim/snapshot.py @@ -20,6 +20,7 @@ from natsort import natsorted import numpy as np import pandas as pd # type: ignore +from tqdm import tqdm State = Hashable @@ -85,10 +86,17 @@ class TimeUpdate(Snapshot): When calling :any:`Simulation.run`, if :any:`snapshots` is empty, then this object will get added to provide a basic progress update. """ + def __init__(self, time_bound: Optional[float] = None, update_time: float = 0.2) -> None: + self.pbar = tqdm(total=time_bound, position=0, leave=False, unit=' time simulated') + self.update_time = update_time + + def initialize(self) -> None: + self.start_time = self.simulation.time def update(self, index: Optional[int] = None) -> None: super().update(index) - print(f'\r Time: {self.time:.3f}', end='\r') + new_n = round(self.time - self.start_time, 3) + self.pbar.update(new_n - self.pbar.n) class Plotter(Snapshot): diff --git a/requirements.txt b/requirements.txt index 950b9e5..417adcb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -numpy +numpy<=1.20.1 cython setuptools ipywidgets