proteus 1.9.0
C/C++/Fortran libraries
Loading...
Searching...
No Matches
Fenton.cpp
Go to the documentation of this file.
1/* Generated by Cython 3.3.0 */
2
3/* BEGIN: Cython Metadata
4{
5 "distutils": {
6 "depends": [
7 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/arrayobject.h",
8 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/arrayscalars.h",
9 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/ndarrayobject.h",
10 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/ndarraytypes.h",
11 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/ufuncobject.h",
12 "proteus/fenton/Fourier.cpp"
13 ],
14 "extra_compile_args": [
15 "-std=c++11"
16 ],
17 "include_dirs": [
18 "proteus/fenton",
19 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include",
20 "proteus",
21 "/work/cekees/miniforge3/envs/proteus-jupyterhub/include"
22 ],
23 "language": "c++",
24 "libraries": [
25 "stdc++",
26 "m"
27 ],
28 "name": "fenton.Fenton",
29 "sources": [
30 "proteus/fenton/Fenton.pyx",
31 "proteus/fenton/Solve.cpp",
32 "proteus/fenton/Dpythag.cpp",
33 "proteus/fenton/Dsvbksb.cpp",
34 "proteus/fenton/Dsvdcmp.cpp",
35 "proteus/fenton/Inout.cpp",
36 "proteus/fenton/Subroutines.cpp",
37 "proteus/fenton/Util.cpp"
38 ]
39 },
40 "module_name": "fenton.Fenton"
41}
42END: Cython Metadata */
43
44#ifndef PY_SSIZE_T_CLEAN
45#define PY_SSIZE_T_CLEAN
46#endif /* PY_SSIZE_T_CLEAN */
47/* InitLimitedAPI */
48#if defined(Py_LIMITED_API)
49 #if !defined(CYTHON_LIMITED_API)
50 #define CYTHON_LIMITED_API 1
51 #endif
52#elif defined(CYTHON_LIMITED_API)
53 #ifdef _MSC_VER
54 #pragma message ("Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.")
55 #else
56 #warning Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.
57 #endif
58#endif
59
60#include "Python.h"
61#ifndef Py_PYTHON_H
62 #error Python headers needed to compile C extensions, please install development version of Python.
63#elif PY_VERSION_HEX < 0x03090000
64 #error Cython requires Python 3.9+.
65#elif defined(Py_LIMITED_API) && (Py_LIMITED_API & 0xFFFF0000) > (PY_VERSION_HEX & 0xFFFF0000)
66 #error 'Py_LIMITED_API' can only select past Python X.Y versions, not future ones.
67#else
68#define __PYX_ABI_VERSION "3_3_0"
69#define CYTHON_HEX_VERSION 0x030300F0
70#define CYTHON_FUTURE_DIVISION 1
71/* CModulePreamble */
72#include <stddef.h>
73#ifndef offsetof
74 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
75#endif
76#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
77 #ifndef __stdcall
78 #define __stdcall
79 #endif
80 #ifndef __cdecl
81 #define __cdecl
82 #endif
83 #ifndef __fastcall
84 #define __fastcall
85 #endif
86#endif
87#ifdef __has_builtin
88 #define __Pyx_has_cbuiltin(name) __has_builtin(name)
89#else
90 #define __Pyx_has_cbuiltin(name) (0)
91#endif
92#ifndef DL_IMPORT
93 #define DL_IMPORT(t) t
94#endif
95#ifndef DL_EXPORT
96 #define DL_EXPORT(t) t
97#endif
98#define __PYX_COMMA ,
99#ifndef PY_LONG_LONG
100 #define PY_LONG_LONG LONG_LONG
101#endif
102#ifndef Py_HUGE_VAL
103 #define Py_HUGE_VAL HUGE_VAL
104#endif
105#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
106#if defined(CYTHON_LIMITED_API)
107 #ifdef Py_LIMITED_API
108 #undef __PYX_LIMITED_VERSION_HEX
109 #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
110 #if Py_LIMITED_API < 0x03090000
111 #error "Cython 3.3 requires the Python Limited API version to be 3.9 or greater."
112 #endif
113 #endif
114 #if defined(GRAALVM_PYTHON) || defined(PYPY_VERSION)
115 #ifdef _MSC_VER
116 #pragma message ("Py_LIMITED_API is defined on PyPy or GraalPy. This takes precedence over Cython's specialized\
117 code for PyPy and GraalPy and is unlikely to work.")
118 #else
119 #warning "Py_LIMITED_API is defined on PyPy or GraalPy. This takes precedence over Cython's specialized\
120 code for PyPy and GraalPy and is unlikely to work."
121 #endif
122 #endif
123 #define CYTHON_COMPILING_IN_PYPY 0
124 #define CYTHON_COMPILING_IN_CPYTHON 0
125 #define CYTHON_COMPILING_IN_LIMITED_API 1
126 #define CYTHON_COMPILING_IN_GRAAL 0
127 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
128 #undef CYTHON_USE_TYPE_SLOTS
129 #define CYTHON_USE_TYPE_SLOTS 0
130 #undef CYTHON_USE_TYPE_SPECS
131 #define CYTHON_USE_TYPE_SPECS 1
132 #undef CYTHON_USE_PYTYPE_LOOKUP
133 #define CYTHON_USE_PYTYPE_LOOKUP 0
134 #undef CYTHON_USE_PYLIST_INTERNALS
135 #define CYTHON_USE_PYLIST_INTERNALS 0
136 #undef CYTHON_USE_UNICODE_INTERNALS
137 #define CYTHON_USE_UNICODE_INTERNALS 0
138 #ifndef CYTHON_USE_UNICODE_WRITER
139 #define CYTHON_USE_UNICODE_WRITER 0
140 #endif
141 #undef CYTHON_USE_PYLONG_INTERNALS
142 #define CYTHON_USE_PYLONG_INTERNALS 0
143 #ifndef CYTHON_AVOID_BORROWED_REFS
144 #define CYTHON_AVOID_BORROWED_REFS 0
145 #endif
146 #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
147 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
148 #endif
149 #undef CYTHON_ASSUME_SAFE_MACROS
150 #define CYTHON_ASSUME_SAFE_MACROS 0
151 #undef CYTHON_ASSUME_SAFE_SIZE
152 #define CYTHON_ASSUME_SAFE_SIZE 0
153 #undef CYTHON_UNPACK_METHODS
154 #define CYTHON_UNPACK_METHODS 0
155 #undef CYTHON_FAST_THREAD_STATE
156 #define CYTHON_FAST_THREAD_STATE 0
157 #undef CYTHON_FAST_GIL
158 #define CYTHON_FAST_GIL 0
159 #undef CYTHON_VECTORCALL
160 #define CYTHON_VECTORCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
161 #ifndef CYTHON_VECTORCALL_TPNEW
162 #define CYTHON_VECTORCALL_TPNEW (CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
163 #endif
164 #ifndef CYTHON_PEP487_INIT_SUBCLASS
165 #define CYTHON_PEP487_INIT_SUBCLASS 1
166 #endif
167 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
168 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
169 #endif
170 #ifndef CYTHON_USE_MODULE_STATE
171 #define CYTHON_USE_MODULE_STATE 0
172 #endif
173 #undef CYTHON_USE_SYS_MONITORING
174 #define CYTHON_USE_SYS_MONITORING 0
175 #ifndef CYTHON_USE_TP_FINALIZE
176 #define CYTHON_USE_TP_FINALIZE (__PYX_LIMITED_VERSION_HEX >= 0x030F0000 && PY_VERSION_HEX > 0x030F00A8)
177 #endif
178 #ifndef CYTHON_USE_AM_SEND
179 #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000)
180 #endif
181 #undef CYTHON_USE_DICT_VERSIONS
182 #define CYTHON_USE_DICT_VERSIONS 0
183 #undef CYTHON_USE_EXC_INFO_STACK
184 #define CYTHON_USE_EXC_INFO_STACK 0
185 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
186 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
187 #endif
188 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
189 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
190 #endif
191 #ifndef CYTHON_USE_FREELISTS
192 #define CYTHON_USE_FREELISTS 1
193 #endif
194 #undef CYTHON_IMMORTAL_CONSTANTS
195 #define CYTHON_IMMORTAL_CONSTANTS 0
196 #if __PYX_LIMITED_VERSION_HEX < 0x030E0000
197 #undef CYTHON_OPAQUE_OBJECTS
198 #define CYTHON_OPAQUE_OBJECTS 0
199 #elif !defined(CYTHON_OPAQUE_OBJECTS)
200 #define CYTHON_OPAQUE_OBJECTS (__PYX_LIMITED_VERSION_HEX >= 0x030F0000)
201 #endif
202#elif defined(GRAALVM_PYTHON)
203 /* For very preliminary testing purposes. Most variables are set the same as PyPy.
204 The existence of this section does not imply that anything works or is even tested */
205 #define CYTHON_COMPILING_IN_PYPY 0
206 #define CYTHON_COMPILING_IN_CPYTHON 0
207 #define CYTHON_COMPILING_IN_LIMITED_API 0
208 #define CYTHON_COMPILING_IN_GRAAL 1
209 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
210 #ifndef CYTHON_USE_TYPE_SLOTS
211 #define CYTHON_USE_TYPE_SLOTS 0
212 #endif
213 #undef CYTHON_USE_TYPE_SPECS
214 #define CYTHON_USE_TYPE_SPECS 0
215 #undef CYTHON_USE_PYTYPE_LOOKUP
216 #define CYTHON_USE_PYTYPE_LOOKUP 0
217 #undef CYTHON_USE_PYLIST_INTERNALS
218 #define CYTHON_USE_PYLIST_INTERNALS 0
219 #undef CYTHON_USE_UNICODE_INTERNALS
220 #define CYTHON_USE_UNICODE_INTERNALS 0
221 #undef CYTHON_USE_UNICODE_WRITER
222 #define CYTHON_USE_UNICODE_WRITER 0
223 #undef CYTHON_USE_PYLONG_INTERNALS
224 #define CYTHON_USE_PYLONG_INTERNALS 0
225 #undef CYTHON_AVOID_BORROWED_REFS
226 #define CYTHON_AVOID_BORROWED_REFS 1
227 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
228 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
229 #undef CYTHON_ASSUME_SAFE_MACROS
230 #define CYTHON_ASSUME_SAFE_MACROS 0
231 #undef CYTHON_ASSUME_SAFE_SIZE
232 #define CYTHON_ASSUME_SAFE_SIZE 0
233 #undef CYTHON_UNPACK_METHODS
234 #define CYTHON_UNPACK_METHODS 0
235 #undef CYTHON_FAST_THREAD_STATE
236 #define CYTHON_FAST_THREAD_STATE 0
237 #undef CYTHON_FAST_GIL
238 #define CYTHON_FAST_GIL 0
239 #ifndef CYTHON_VECTORCALL
240 #define CYTHON_VECTORCALL 1
241 #endif
242 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
243 #undef CYTHON_VECTORCALL_TPNEW
244 #define CYTHON_VECTORCALL_TPNEW 0
245 #elif !defined(CYTHON_VECTORCALL_TPNEW)
246 #define CYTHON_VECTORCALL_TPNEW CYTHON_VECTORCALL
247 #endif
248 #ifndef CYTHON_PEP487_INIT_SUBCLASS
249 #define CYTHON_PEP487_INIT_SUBCLASS 1
250 #endif
251 #undef CYTHON_PEP489_MULTI_PHASE_INIT
252 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
253 #undef CYTHON_USE_MODULE_STATE
254 #define CYTHON_USE_MODULE_STATE 0
255 #undef CYTHON_USE_SYS_MONITORING
256 #define CYTHON_USE_SYS_MONITORING 0
257 #undef CYTHON_USE_TP_FINALIZE
258 #define CYTHON_USE_TP_FINALIZE 0
259 #undef CYTHON_USE_AM_SEND
260 #define CYTHON_USE_AM_SEND 0
261 #undef CYTHON_USE_DICT_VERSIONS
262 #define CYTHON_USE_DICT_VERSIONS 0
263 #undef CYTHON_USE_EXC_INFO_STACK
264 #define CYTHON_USE_EXC_INFO_STACK 1
265 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
266 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
267 #endif
268 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
269 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
270 #endif
271 #undef CYTHON_USE_FREELISTS
272 #define CYTHON_USE_FREELISTS 0
273 #undef CYTHON_IMMORTAL_CONSTANTS
274 #define CYTHON_IMMORTAL_CONSTANTS 0
275 #undef CYTHON_OPAQUE_OBJECTS
276 #define CYTHON_OPAQUE_OBJECTS 0
277#elif defined(PYPY_VERSION)
278 #define CYTHON_COMPILING_IN_PYPY 1
279 #define CYTHON_COMPILING_IN_CPYTHON 0
280 #define CYTHON_COMPILING_IN_LIMITED_API 0
281 #define CYTHON_COMPILING_IN_GRAAL 0
282 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
283 #undef CYTHON_USE_TYPE_SLOTS
284 #define CYTHON_USE_TYPE_SLOTS 1
285 #ifndef CYTHON_USE_TYPE_SPECS
286 #define CYTHON_USE_TYPE_SPECS 0
287 #endif
288 #undef CYTHON_USE_PYTYPE_LOOKUP
289 #define CYTHON_USE_PYTYPE_LOOKUP 0
290 #undef CYTHON_USE_PYLIST_INTERNALS
291 #define CYTHON_USE_PYLIST_INTERNALS 0
292 #undef CYTHON_USE_UNICODE_INTERNALS
293 #define CYTHON_USE_UNICODE_INTERNALS 0
294 #undef CYTHON_USE_UNICODE_WRITER
295 #define CYTHON_USE_UNICODE_WRITER 0
296 #undef CYTHON_USE_PYLONG_INTERNALS
297 #define CYTHON_USE_PYLONG_INTERNALS 0
298 #undef CYTHON_AVOID_BORROWED_REFS
299 #define CYTHON_AVOID_BORROWED_REFS 1
300 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
301 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
302 #undef CYTHON_ASSUME_SAFE_MACROS
303 #define CYTHON_ASSUME_SAFE_MACROS 0
304 #ifndef CYTHON_ASSUME_SAFE_SIZE
305 #define CYTHON_ASSUME_SAFE_SIZE 1
306 #endif
307 #undef CYTHON_UNPACK_METHODS
308 #define CYTHON_UNPACK_METHODS 0
309 #undef CYTHON_FAST_THREAD_STATE
310 #define CYTHON_FAST_THREAD_STATE 0
311 #undef CYTHON_FAST_GIL
312 #define CYTHON_FAST_GIL 0
313 #ifndef CYTHON_VECTORCALL
314 #define CYTHON_VECTORCALL 1
315 #endif
316 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
317 #undef CYTHON_VECTORCALL_TPNEW
318 #define CYTHON_VECTORCALL_TPNEW 0
319 #elif !defined(CYTHON_VECTORCALL_TPNEW)
320 #define CYTHON_VECTORCALL_TPNEW (PYPY_VERSION_NUM >= 0x07030800 && CYTHON_VECTORCALL)
321 #endif
322 #ifndef CYTHON_PEP487_INIT_SUBCLASS
323 #define CYTHON_PEP487_INIT_SUBCLASS 1
324 #endif
325 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
326 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
327 #endif
328 #undef CYTHON_USE_MODULE_STATE
329 #define CYTHON_USE_MODULE_STATE 0
330 #undef CYTHON_USE_SYS_MONITORING
331 #define CYTHON_USE_SYS_MONITORING 0
332 #ifndef CYTHON_USE_TP_FINALIZE
333 #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00)
334 #endif
335 #undef CYTHON_USE_AM_SEND
336 #define CYTHON_USE_AM_SEND 0
337 #undef CYTHON_USE_DICT_VERSIONS
338 #define CYTHON_USE_DICT_VERSIONS 0
339 #undef CYTHON_USE_EXC_INFO_STACK
340 #define CYTHON_USE_EXC_INFO_STACK 0
341 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
342 #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_NUM >= 0x07031100)
343 #endif
344 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
345 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
346 #endif
347 #undef CYTHON_USE_FREELISTS
348 #define CYTHON_USE_FREELISTS 0
349 #undef CYTHON_IMMORTAL_CONSTANTS
350 #define CYTHON_IMMORTAL_CONSTANTS 0
351 #undef CYTHON_OPAQUE_OBJECTS
352 #define CYTHON_OPAQUE_OBJECTS 0
353#else
354 #define CYTHON_COMPILING_IN_PYPY 0
355 #define CYTHON_COMPILING_IN_CPYTHON 1
356 #define CYTHON_COMPILING_IN_LIMITED_API 0
357 #define CYTHON_COMPILING_IN_GRAAL 0
358 #ifdef Py_GIL_DISABLED
359 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1
360 #else
361 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
362 #endif
363 #if PY_VERSION_HEX < 0x030A0000
364 #undef CYTHON_USE_TYPE_SLOTS
365 #define CYTHON_USE_TYPE_SLOTS 1
366 #elif !defined(CYTHON_USE_TYPE_SLOTS)
367 #define CYTHON_USE_TYPE_SLOTS 1
368 #endif
369 #ifndef CYTHON_USE_TYPE_SPECS
370 #define CYTHON_USE_TYPE_SPECS 0
371 #endif
372 #ifndef CYTHON_USE_PYTYPE_LOOKUP
373 #define CYTHON_USE_PYTYPE_LOOKUP 1
374 #endif
375 #ifndef CYTHON_USE_PYLONG_INTERNALS
376 #define CYTHON_USE_PYLONG_INTERNALS 1
377 #endif
378 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
379 #undef CYTHON_USE_PYLIST_INTERNALS
380 #define CYTHON_USE_PYLIST_INTERNALS 0
381 #elif !defined(CYTHON_USE_PYLIST_INTERNALS)
382 #define CYTHON_USE_PYLIST_INTERNALS 1
383 #endif
384 #ifndef CYTHON_USE_UNICODE_INTERNALS
385 #define CYTHON_USE_UNICODE_INTERNALS 1
386 #endif
387 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2
388 #undef CYTHON_USE_UNICODE_WRITER
389 #define CYTHON_USE_UNICODE_WRITER 0
390 #elif !defined(CYTHON_USE_UNICODE_WRITER)
391 #define CYTHON_USE_UNICODE_WRITER 1
392 #endif
393 #ifndef CYTHON_AVOID_BORROWED_REFS
394 #define CYTHON_AVOID_BORROWED_REFS 0
395 #endif
396 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
397 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
398 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
399 #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)
400 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
401 #endif
402 #ifndef CYTHON_ASSUME_SAFE_MACROS
403 #define CYTHON_ASSUME_SAFE_MACROS 1
404 #endif
405 #ifndef CYTHON_ASSUME_SAFE_SIZE
406 #define CYTHON_ASSUME_SAFE_SIZE 1
407 #endif
408 #ifndef CYTHON_UNPACK_METHODS
409 #define CYTHON_UNPACK_METHODS 1
410 #endif
411 #ifndef CYTHON_FAST_THREAD_STATE
412 #define CYTHON_FAST_THREAD_STATE 1
413 #endif
414 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
415 #undef CYTHON_FAST_GIL
416 #define CYTHON_FAST_GIL 0
417 #elif !defined(CYTHON_FAST_GIL)
418 #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6)
419 #endif
420 #ifndef CYTHON_VECTORCALL
421 #define CYTHON_VECTORCALL 1
422 #endif
423 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
424 #undef CYTHON_VECTORCALL_TPNEW
425 #define CYTHON_VECTORCALL_TPNEW 0
426 #elif !defined(CYTHON_VECTORCALL_TPNEW)
427 #define CYTHON_VECTORCALL_TPNEW CYTHON_VECTORCALL
428 #endif
429 #ifndef CYTHON_PEP487_INIT_SUBCLASS
430 #define CYTHON_PEP487_INIT_SUBCLASS 1
431 #endif
432 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
433 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
434 #endif
435 #ifndef CYTHON_USE_MODULE_STATE
436 #define CYTHON_USE_MODULE_STATE 0
437 #endif
438 #ifndef CYTHON_USE_SYS_MONITORING
439 #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1)
440 #endif
441 #ifndef CYTHON_USE_TP_FINALIZE
442 #define CYTHON_USE_TP_FINALIZE 1
443 #endif
444 #ifndef CYTHON_USE_AM_SEND
445 #define CYTHON_USE_AM_SEND 1
446 #endif
447 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
448 #undef CYTHON_USE_DICT_VERSIONS
449 #define CYTHON_USE_DICT_VERSIONS 0
450 #elif !defined(CYTHON_USE_DICT_VERSIONS)
451 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE)
452 #endif
453 #ifndef CYTHON_USE_EXC_INFO_STACK
454 #define CYTHON_USE_EXC_INFO_STACK 1
455 #endif
456 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
457 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
458 #endif
459 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
460 #define CYTHON_USE_OWN_PREP_RERAISE_STAR (PY_VERSION_HEX < 0x030C00B2)
461 #endif
462 #ifndef CYTHON_USE_FREELISTS
463 #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
464 #endif
465 #if defined(CYTHON_IMMORTAL_CONSTANTS) && PY_VERSION_HEX < 0x030C0000
466 #undef CYTHON_IMMORTAL_CONSTANTS
467 #define CYTHON_IMMORTAL_CONSTANTS 0 // definitely won't work
468 #elif !defined(CYTHON_IMMORTAL_CONSTANTS)
469 #define CYTHON_IMMORTAL_CONSTANTS (PY_VERSION_HEX >= 0x030C0000 && !CYTHON_USE_MODULE_STATE && CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
470 #endif
471 #ifndef CYTHON_OPAQUE_OBJECTS
472 #define CYTHON_OPAQUE_OBJECTS 0
473 #endif
474#endif
475#if CYTHON_USE_PYLONG_INTERNALS
476 #undef SHIFT
477 #undef BASE
478 #undef MASK
479 #ifdef SIZEOF_VOID_P
480 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
481 #endif
482#endif
483#ifndef __has_attribute
484 #define __has_attribute(x) 0
485#endif
486#ifndef __has_cpp_attribute
487 #define __has_cpp_attribute(x) 0
488#endif
489#ifndef CYTHON_RESTRICT
490 #if defined(__GNUC__)
491 #define CYTHON_RESTRICT __restrict__
492 #elif defined(_MSC_VER) && _MSC_VER >= 1400
493 #define CYTHON_RESTRICT __restrict
494 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
495 #define CYTHON_RESTRICT restrict
496 #else
497 #define CYTHON_RESTRICT
498 #endif
499#endif
500#ifndef CYTHON_UNUSED
501 #if defined(__cplusplus)
502 /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17
503 * but leads to warnings with -pedantic, since it is a C++17 feature */
504 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
505 #if __has_cpp_attribute(maybe_unused)
506 #define CYTHON_UNUSED [[maybe_unused]]
507 #endif
508 #endif
509 #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
510 #define CYTHON_UNUSED [[maybe_unused]]
511 #endif
512#endif
513#ifndef CYTHON_UNUSED
514# if defined(__GNUC__)
515# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
516# define CYTHON_UNUSED __attribute__ ((__unused__))
517# else
518# define CYTHON_UNUSED
519# endif
520# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
521# define CYTHON_UNUSED __attribute__ ((__unused__))
522# else
523# define CYTHON_UNUSED
524# endif
525#endif
526#ifndef CYTHON_UNUSED_VAR
527# if defined(__cplusplus)
528 template<class T> void CYTHON_UNUSED_VAR( const T& ) { }
529# else
530# define CYTHON_UNUSED_VAR(x) (void)(x)
531# endif
532#endif
533#ifndef CYTHON_MAYBE_UNUSED_VAR
534 #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
535#endif
536#ifndef CYTHON_NCP_UNUSED
537# if CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
538# define CYTHON_NCP_UNUSED
539# else
540# define CYTHON_NCP_UNUSED CYTHON_UNUSED
541# endif
542#endif
543#ifndef CYTHON_USE_CPP_STD_MOVE
544 #if defined(__cplusplus) && (\
545 __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
546 #define CYTHON_USE_CPP_STD_MOVE 1
547 #else
548 #define CYTHON_USE_CPP_STD_MOVE 0
549 #endif
550#endif
551#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
552#include <stdint.h>
553typedef uintptr_t __pyx_uintptr_t;
554#ifndef CYTHON_FALLTHROUGH
555 #if defined(__cplusplus)
556 /* for clang __has_cpp_attribute(fallthrough) is true even before C++17
557 * but leads to warnings with -pedantic, since it is a C++17 feature */
558 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
559 #if __has_cpp_attribute(fallthrough)
560 #define CYTHON_FALLTHROUGH [[fallthrough]]
561 #endif
562 #endif
563 #ifndef CYTHON_FALLTHROUGH
564 #if __has_cpp_attribute(clang::fallthrough)
565 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
566 #elif __has_cpp_attribute(gnu::fallthrough)
567 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
568 #endif
569 #endif
570 #endif
571 #ifndef CYTHON_FALLTHROUGH
572 #if __has_attribute(fallthrough)
573 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
574 #else
575 #define CYTHON_FALLTHROUGH
576 #endif
577 #endif
578 #if defined(__clang__) && defined(__apple_build_version__)
579 #if __apple_build_version__ < 7000000
580 #undef CYTHON_FALLTHROUGH
581 #define CYTHON_FALLTHROUGH
582 #endif
583 #endif
584#endif
585#ifdef Py_UNREACHABLE
586 #define __Pyx_UNREACHABLE() Py_UNREACHABLE()
587#elif __Pyx_has_cbuiltin(__builtin_unreachable)
588 #define __Pyx_UNREACHABLE() __builtin_unreachable()
589#elif defined(__clang__) || defined(__INTEL_COMPILER) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)))
590 #define __Pyx_UNREACHABLE() __builtin_unreachable()
591#elif defined(_MSC_VER)
592 #define __Pyx_UNREACHABLE() __assume(0)
593#else
594 #define __Pyx_UNREACHABLE() Py_FatalError("Unreachable C code path reached")
595#endif
596#ifndef Py_UNREACHABLE
597 #define Py_UNREACHABLE() __Pyx_UNREACHABLE()
598#endif
599#ifdef __cplusplus
600 template <typename T>
601 struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};
602 #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
603#else
604 #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
605#endif
606#if CYTHON_COMPILING_IN_PYPY == 1
607 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX < 0x030A0000)
608#else
609 #define __PYX_NEED_TP_PRINT_SLOT 0
610#endif
611#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))
612#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
613#define __Pyx_PyErr_FetchException(petype, peval, petb) PyErr_Fetch(petype, peval, petb)
614#define __Pyx_PyErr_RestoreException(etype, eval, etb) PyErr_Restore(etype, eval, etb)
615#else
616#define __Pyx_PyErr_FetchException(petype, peval, petb) *(petype)=NULL; *(peval)=PyErr_GetRaisedException(); *(petb)=NULL
617#define __Pyx_PyErr_RestoreException(etype, eval, etb) PyErr_SetRaisedException(eval)
618#endif
619
620/* CppInitCode */
621#ifndef __cplusplus
622 #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
623#endif
624#ifndef CYTHON_INLINE
625 #if defined(__clang__)
626 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
627 #else
628 #define CYTHON_INLINE inline
629 #endif
630#endif
631template<typename T>
632void __Pyx_call_destructor(T& x) {
633 x.~T();
634}
635template<typename T>
636class __Pyx_FakeReference {
637 public:
638 __Pyx_FakeReference() : ptr(NULL) { }
639 __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
640 T *operator->() { return ptr; }
641 T *operator&() { return ptr; }
642 operator T&() { return *ptr; }
643 template<typename U> bool operator ==(const U& other) const { return *ptr == other; }
644 template<typename U> bool operator !=(const U& other) const { return *ptr != other; }
645 template<typename U> bool operator==(const __Pyx_FakeReference<U>& other) const { return *ptr == *other.ptr; }
646 template<typename U> bool operator!=(const __Pyx_FakeReference<U>& other) const { return *ptr != *other.ptr; }
647 private:
648 T *ptr;
649};
650
651/* PythonCompatibility */
652#define __PYX_BUILD_PY_SSIZE_T "n"
653#define CYTHON_FORMAT_SSIZE_T "z"
654#define __Pyx_BUILTIN_MODULE_NAME "builtins"
655#define __Pyx_DefaultClassType PyType_Type
656#if CYTHON_COMPILING_IN_LIMITED_API
657 #ifndef CO_OPTIMIZED
658 static int CO_OPTIMIZED;
659 #endif
660 #ifndef CO_NEWLOCALS
661 static int CO_NEWLOCALS;
662 #endif
663 #ifndef CO_VARARGS
664 static int CO_VARARGS;
665 #endif
666 #ifndef CO_VARKEYWORDS
667 static int CO_VARKEYWORDS;
668 #endif
669 #ifndef CO_ASYNC_GENERATOR
670 static int CO_ASYNC_GENERATOR;
671 #endif
672 #ifndef CO_GENERATOR
673 static int CO_GENERATOR;
674 #endif
675 #ifndef CO_COROUTINE
676 static int CO_COROUTINE;
677 #endif
678#else
679 #ifndef CO_COROUTINE
680 #define CO_COROUTINE 0x80
681 #endif
682 #ifndef CO_ASYNC_GENERATOR
683 #define CO_ASYNC_GENERATOR 0x200
684 #endif
685#endif
686static int __Pyx_init_co_variables(void);
687#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
688 #define __Pyx_Py_Is(x, y) Py_Is(x, y)
689#else
690 #define __Pyx_Py_Is(x, y) ((x) == (y))
691#endif
692#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
693 #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
694#else
695 #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
696#endif
697#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
698 #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
699#else
700 #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
701#endif
702#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
703 #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
704#else
705 #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
706#endif
707#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj))
708#if CYTHON_COMPILING_IN_PYPY
709 #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
710#else
711 #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
712#endif
713#if CYTHON_COMPILING_IN_LIMITED_API
714static unsigned long __Pyx_Runtime_TPFLAGS_SEQUENCE;
715static unsigned long __Pyx_Runtime_TPFLAGS_MAPPING;
716#else
717#define __Pyx_Runtime_TPFLAGS_SEQUENCE Py_TPFLAGS_SEQUENCE
718#define __Pyx_Runtime_TPFLAGS_MAPPING Py_TPFLAGS_MAPPING
719#endif
720static int __Pyx_init_tpflags_variables(void);
721#ifndef Py_TPFLAGS_HAVE_FINALIZE
722 #define Py_TPFLAGS_HAVE_FINALIZE 0
723#endif
724#ifndef Py_TPFLAGS_SEQUENCE
725 #define Py_TPFLAGS_SEQUENCE (CYTHON_COMPILING_IN_LIMITED_API ? 0 : 1 << 5)
726#endif
727#ifndef Py_TPFLAGS_MAPPING
728 #define Py_TPFLAGS_MAPPING (CYTHON_COMPILING_IN_LIMITED_API ? 0 : 1 << 6)
729#endif
730#ifndef Py_TPFLAGS_IMMUTABLETYPE
731 #define Py_TPFLAGS_IMMUTABLETYPE (1UL << 8)
732#endif
733#ifndef Py_TPFLAGS_DISALLOW_INSTANTIATION
734 #define Py_TPFLAGS_DISALLOW_INSTANTIATION (1UL << 7)
735#endif
736#ifndef METH_STACKLESS
737 #define METH_STACKLESS 0
738#endif
739#if !defined(METH_FASTCALL) || CYTHON_COMPILING_IN_PYPY
740 #ifndef METH_FASTCALL
741 #define METH_FASTCALL 0x80
742 #endif
743 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
744 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
745 Py_ssize_t nargs, PyObject *kwnames);
746#else
747 #if PY_VERSION_HEX >= 0x030d00A4
748 # define __Pyx_PyCFunctionFast PyCFunctionFast
749 # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
750 #else
751 # define __Pyx_PyCFunctionFast _PyCFunctionFast
752 # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
753 #endif
754#endif
755#if CYTHON_VECTORCALL
756 #define __Pyx_METH_FASTCALL METH_FASTCALL
757 #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
758 #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
759#else
760 #define __Pyx_METH_FASTCALL METH_VARARGS
761 #define __Pyx_PyCFunction_FastCall PyCFunction
762 #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
763#endif
764#if CYTHON_VECTORCALL
765 #define __pyx_vectorcallfunc vectorcallfunc
766 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET
767 #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n))
768#else
769 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0
770 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n))
771#endif
772#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func)
773#define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func)
774#if CYTHON_COMPILING_IN_CPYTHON
775#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth)
776#elif !CYTHON_COMPILING_IN_LIMITED_API
777#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func)
778#endif
779#if CYTHON_COMPILING_IN_CPYTHON
780#define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags)
781static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
782 return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
783}
784#endif
785static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(void)) {
786#if CYTHON_COMPILING_IN_LIMITED_API
787 return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
788#else
789 return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
790#endif
791}
792#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc)
793#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
794 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b))
795#else
796 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b)
797#endif
798#if CYTHON_COMPILING_IN_PYPY
799 typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
800#else
801 #define __Pyx_PyCMethod PyCMethod
802#endif
803#ifndef METH_METHOD
804 #define METH_METHOD 0x200
805#endif
806#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
807 #define PyObject_Malloc(s) PyMem_Malloc(s)
808 #define PyObject_Free(p) PyMem_Free(p)
809 #define PyObject_Realloc(p) PyMem_Realloc(p)
810#endif
811#if CYTHON_COMPILING_IN_LIMITED_API
812 #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
813#elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
814 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
815 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) GraalPyFrame_SetLineNumber((frame), (lineno))
816#elif CYTHON_COMPILING_IN_GRAAL
817 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
818 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno))
819#else
820 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
821 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
822#endif
823#if CYTHON_COMPILING_IN_LIMITED_API
824 #define __Pyx_PyThreadState_Current PyThreadState_Get()
825#elif !CYTHON_FAST_THREAD_STATE
826 #define __Pyx_PyThreadState_Current PyThreadState_GET()
827#elif PY_VERSION_HEX >= 0x030d00A1
828 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
829#else
830 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
831#endif
832#if CYTHON_OPAQUE_OBJECTS && CYTHON_COMPILING_IN_LIMITED_API
833 #define __PYX_SHARED_SIZEOF(T) -((int)sizeof(T))
834 #define __PYX_SHARED_RELATIVE_OFFSET Py_RELATIVE_OFFSET
835 #define CYTHON_OPAQUE_SHARED_TYPES 1
836#else
837 #define __PYX_SHARED_SIZEOF(T) sizeof(T)
838 #define __PYX_SHARED_RELATIVE_OFFSET 0
839 #define CYTHON_OPAQUE_SHARED_TYPES 0
840#endif
841#if CYTHON_USE_MODULE_STATE
842static CYTHON_INLINE void *__Pyx__PyModule_GetState(PyObject *op)
843{
844 void *result;
845 result = PyModule_GetState(op);
846 if (!result)
847 Py_FatalError("Couldn't find the module state");
848 return result;
849}
850#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o)
851#else
852#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global)
853#endif
854#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype)
855#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype)
856#define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
857#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
858#if CYTHON_USE_TYPE_SLOTS
859 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name)
860 #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype)
861 #define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL)
862 #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype)
863#else
864 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name))
865 #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\
866 ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\
867 (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\
868 __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL)
869 #define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype)
870 #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype)
871#endif
872#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
873#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
874#else
875#define __Pyx_PyDict_NewPresized(n) PyDict_New()
876#endif
877#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
878#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
879#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_UNICODE_INTERNALS
880#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
881static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
882 PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
883 if (res == NULL && PyErr_Occurred()) {
884 PyErr_WriteUnraisable(NULL);
885 }
886 return res;
887}
888#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000
889#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError
890#define __Pyx_PyDict_GetItemStr PyDict_GetItem
891#else
892static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
893#if CYTHON_COMPILING_IN_PYPY
894 return PyDict_GetItem(dict, name);
895#else
896 PyDictEntry *ep;
897 PyDictObject *mp = (PyDictObject*) dict;
898 long hash = ((PyStringObject *) name)->ob_shash;
899 assert(hash != -1);
900 ep = (mp->ma_lookup)(mp, name, hash);
901 if (ep == NULL) {
902 return NULL;
903 }
904 return ep->me_value;
905#endif
906}
907#define __Pyx_PyDict_GetItemStr PyDict_GetItem
908#endif
909#if CYTHON_USE_TYPE_SLOTS
910 #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags)
911 #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
912#else
913 #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp))
914 #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature)
915#endif
916#define __Pyx_PyObject_GetIterNextFunc(iterator) __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc)
917#if CYTHON_USE_TYPE_SPECS
918#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\
919 PyTypeObject *type = Py_TYPE((PyObject*)obj);\
920 assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
921 PyObject_GC_Del(obj);\
922 Py_DECREF(type);\
923}
924#else
925#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj)
926#endif
927#if CYTHON_COMPILING_IN_LIMITED_API
928 #define __Pyx_PyUnicode_READY(op) (0)
929 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
930 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U)
931 #define __Pyx_PyUnicode_KIND(u) ((void)u, (0))
932 #define __Pyx_PyUnicode_KIND_04(u) __Pyx_PyUnicode_KIND(u)
933 #define __Pyx_PyUnicode_DATA(u) ((void*)u)
934 #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
935 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u))
936#else
937 #if PY_VERSION_HEX >= 0x030C0000
938 #define __Pyx_PyUnicode_READY(op) (0)
939 #else
940 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
941 0 : _PyUnicode_Ready((PyObject *)(op)))
942 #endif
943 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
944 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
945 #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u))
946 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
947 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
948 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
949 #if PY_VERSION_HEX >= 0x030C0000
950 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
951 #else
952 #if CYTHON_COMPILING_IN_CPYTHON
953 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
954 #else
955 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
956 #endif
957 #endif
958 static CYTHON_INLINE int __Pyx_PyUnicode_KIND_04(PyObject *o) {
959 return __Pyx_PyUnicode_KIND(o) - (int) !!PyUnicode_IS_ASCII(o);
960 }
961#endif
962#if CYTHON_COMPILING_IN_PYPY
963 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
964 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
965#else
966 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
967 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
968 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
969#endif
970#if CYTHON_COMPILING_IN_PYPY
971 #if !defined(PyUnicode_DecodeUnicodeEscape)
972 #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors)
973 #endif
974 #if !defined(PyUnicode_Contains)
975 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
976 #endif
977 #if !defined(PyByteArray_Check)
978 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
979 #endif
980 #if !defined(PyObject_Format)
981 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
982 #endif
983#endif
984#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
985#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
986 #define __Pyx_PySequence_ListKeepNew(obj)\
987 (likely(PyList_CheckExact(obj) && PyUnstable_Object_IsUniquelyReferenced(obj)) ? __Pyx_NewRef(obj) : PySequence_List(obj))
988#elif CYTHON_COMPILING_IN_CPYTHON
989 #define __Pyx_PySequence_ListKeepNew(obj)\
990 (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
991#else
992 #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj)
993#endif
994#ifndef PySet_CheckExact
995 #define PySet_CheckExact(obj) Py_IS_TYPE(obj, &PySet_Type)
996#endif
997enum __Pyx_ReferenceSharing {
998 __Pyx_ReferenceSharing_DefinitelyUnique, // We created it so we know it's unshared - no need to check
999 __Pyx_ReferenceSharing_OwnStrongReference,
1000 __Pyx_ReferenceSharing_FunctionArgument,
1001 __Pyx_ReferenceSharing_SharedReference, // Never trust it to be unshared because it's a global or similar
1002};
1003#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX >= 0x030E0000
1004#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing)\
1005 (sharing == __Pyx_ReferenceSharing_DefinitelyUnique ? 1 :\
1006 (sharing == __Pyx_ReferenceSharing_FunctionArgument ? PyUnstable_Object_IsUniqueReferencedTemporary(o) :\
1007 (sharing == __Pyx_ReferenceSharing_OwnStrongReference ? PyUnstable_Object_IsUniquelyReferenced(o) : 0)))
1008#elif (CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) || CYTHON_COMPILING_IN_LIMITED_API
1009#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)sharing), Py_REFCNT(o) == 1)
1010#else
1011#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0)
1012#endif
1013#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
1014 #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
1015#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1016 #if CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
1017 #define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1018 #else
1019 #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i)
1020 #endif
1021#elif CYTHON_COMPILING_IN_LIMITED_API || !(CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE)
1022 #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i))
1023#else
1024 #define __Pyx_PyList_GetItemRef(o, i) (likely(__Pyx_is_valid_index(i, PyList_GET_SIZE(o))) ?\
1025 __Pyx_NewRef(PyList_GET_ITEM(o, i)) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1026#endif
1027#if CYTHON_AVOID_BORROWED_REFS || CYTHON_COMPILING_IN_LIMITED_API
1028 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1029 __Pyx_PyList_GetItemRef(o, i))
1030#elif CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1031 #if CYTHON_ASSUME_SAFE_MACROS
1032 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\
1033 __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
1034 __Pyx_NewRef(PyList_GET_ITEM(o, i)) : __Pyx_PyList_GetItemRef(o, i))
1035 #else
1036 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\
1037 __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
1038 __Pyx_XNewRef(PyList_GetItem(o, i)) : __Pyx_PyList_GetItemRef(o, i))
1039 #endif
1040#elif CYTHON_ASSUME_SAFE_MACROS
1041 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1042 __Pyx_NewRef(PyList_GET_ITEM(o, i)))
1043#else
1044 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1045 __Pyx_XNewRef(PyList_GetItem(o, i)))
1046#endif
1047#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
1048#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result)
1049#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1050static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
1051 *result = PyObject_GetItem(dict, key);
1052 if (*result == NULL) {
1053 if (PyErr_ExceptionMatches(PyExc_KeyError)) {
1054 PyErr_Clear();
1055 return 0;
1056 }
1057 return -1;
1058 }
1059 return 1;
1060}
1061#else
1062static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
1063 *result = PyDict_GetItemWithError(dict, key);
1064 if (*result == NULL) {
1065 return PyErr_Occurred() ? -1 : 0;
1066 }
1067 Py_INCREF(*result);
1068 return 1;
1069}
1070#endif
1071#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST
1072 #define __Pyx_VISIT_CONST(obj) Py_VISIT(obj)
1073#else
1074 #define __Pyx_VISIT_CONST(obj)
1075#endif
1076#if CYTHON_ASSUME_SAFE_MACROS
1077 #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
1078 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
1079 #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
1080 #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i)
1081 #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
1082 #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i)
1083#else
1084 #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
1085 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
1086 #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
1087 #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i)
1088 #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
1089 #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i)
1090#endif
1091#if CYTHON_ASSUME_SAFE_SIZE
1092 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
1093 #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
1094 #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
1095 #define __Pyx_PyDict_GET_SIZE(o) PyDict_GET_SIZE(o)
1096 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
1097 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
1098 #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o)
1099#else
1100 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
1101 #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
1102 #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
1103 #define __Pyx_PyDict_GET_SIZE(o) PyDict_Size(o)
1104 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
1105 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
1106 #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o)
1107#endif
1108#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString)
1109 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
1110#endif
1111#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t
1112#define __Pyx_PyLong_AsHash_t __Pyx_PyIndex_AsSsize_t
1113#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000
1114 #define __Pyx_PySendResult PySendResult
1115#else
1116 typedef enum {
1117 PYGEN_RETURN = 0,
1118 PYGEN_ERROR = -1,
1119 PYGEN_NEXT = 1,
1120 } __Pyx_PySendResult;
1121#endif
1122#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3
1123 typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result);
1124#else
1125 #define __Pyx_pyiter_sendfunc sendfunc
1126#endif
1127#if !CYTHON_USE_AM_SEND
1128#define __PYX_HAS_PY_AM_SEND 0
1129#elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000
1130#define __PYX_HAS_PY_AM_SEND 1
1131#else
1132#define __PYX_HAS_PY_AM_SEND 2 // our own backported implementation
1133#endif
1134#if __PYX_HAS_PY_AM_SEND < 2
1135 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
1136#else
1137 typedef struct {
1138 unaryfunc am_await;
1139 unaryfunc am_aiter;
1140 unaryfunc am_anext;
1141 __Pyx_pyiter_sendfunc am_send;
1142 } __Pyx_PyAsyncMethodsStruct;
1143 #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s))
1144#endif
1145#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0
1146 #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21)
1147#else
1148 #define __Pyx_TPFLAGS_HAVE_AM_SEND (0)
1149#endif
1150#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000
1151#ifdef __cplusplus
1152extern "C"
1153#endif
1154PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize);
1155#endif
1156#if CYTHON_COMPILING_IN_LIMITED_API
1157static int __Pyx_init_co_variable(PyObject *inspect, const char* name, int *write_to) {
1158 int value;
1159 PyObject *py_value = PyObject_GetAttrString(inspect, name);
1160 if (!py_value) return 0;
1161 value = (int) PyLong_AsLong(py_value);
1162 Py_DECREF(py_value);
1163 *write_to = value;
1164 return value != -1 || !PyErr_Occurred();
1165}
1166static int __Pyx_init_co_variables(void) {
1167 PyObject *inspect;
1168 int result;
1169 inspect = PyImport_ImportModule("inspect");
1170 result =
1171#if !defined(CO_OPTIMIZED)
1172 __Pyx_init_co_variable(inspect, "CO_OPTIMIZED", &CO_OPTIMIZED) &&
1173#endif
1174#if !defined(CO_NEWLOCALS)
1175 __Pyx_init_co_variable(inspect, "CO_NEWLOCALS", &CO_NEWLOCALS) &&
1176#endif
1177#if !defined(CO_VARARGS)
1178 __Pyx_init_co_variable(inspect, "CO_VARARGS", &CO_VARARGS) &&
1179#endif
1180#if !defined(CO_VARKEYWORDS)
1181 __Pyx_init_co_variable(inspect, "CO_VARKEYWORDS", &CO_VARKEYWORDS) &&
1182#endif
1183#if !defined(CO_ASYNC_GENERATOR)
1184 __Pyx_init_co_variable(inspect, "CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) &&
1185#endif
1186#if !defined(CO_GENERATOR)
1187 __Pyx_init_co_variable(inspect, "CO_GENERATOR", &CO_GENERATOR) &&
1188#endif
1189#if !defined(CO_COROUTINE)
1190 __Pyx_init_co_variable(inspect, "CO_COROUTINE", &CO_COROUTINE) &&
1191#endif
1192 1;
1193 Py_DECREF(inspect);
1194 return result ? 0 : -1;
1195}
1196static int __Pyx_init_tpflags_bitcount(unsigned long flag) {
1197 int count = 0;
1198 while (flag) {
1199 count += (int) (flag & 1);
1200 flag >>= 1;
1201 }
1202 return count;
1203}
1204static int __Pyx_init_tpflags_variables(void) {
1205 if (__Pyx_Runtime_TPFLAGS_SEQUENCE != 0 && __Pyx_Runtime_TPFLAGS_MAPPING != 0) {
1206 return 0;
1207 }
1208 PyObject *collections_abc = PyImport_ImportModule("collections.abc");
1209 if (!collections_abc) return -1;
1210 int result = 0;
1211 PyObject *sequence = NULL, *mapping = NULL;
1212#if __PYX_LIMITED_VERSION_HEX >= 0x030D0000
1213 if (PyObject_GetOptionalAttrString(collections_abc, "Sequence", &sequence) != 1) goto fail;
1214 if (PyObject_GetOptionalAttrString(collections_abc, "Mapping", &mapping) != 1) goto fail;
1215#else
1216 sequence = PyObject_GetAttrString(collections_abc, "Sequence");
1217 if (!sequence) goto fail_attr_lookup;
1218 mapping = PyObject_GetAttrString(collections_abc, "Mapping");
1219 if (!mapping) goto fail_attr_lookup;
1220#endif
1221 if (!PyType_Check(sequence) || !PyType_Check(mapping)) goto fail;
1222 {
1223 unsigned long sequence_flags = PyType_GetFlags((PyTypeObject*)sequence);
1224 unsigned long mapping_flags = PyType_GetFlags((PyTypeObject*)mapping);
1225 unsigned long mutual_flags = sequence_flags & mapping_flags;
1226 sequence_flags = sequence_flags ^ mutual_flags;
1227 mapping_flags = mapping_flags ^ mutual_flags;
1228 if (__Pyx_Runtime_TPFLAGS_SEQUENCE == 0 && __Pyx_init_tpflags_bitcount(sequence_flags) == 1) {
1229 __Pyx_Runtime_TPFLAGS_SEQUENCE = sequence_flags;
1230 }
1231 if (__Pyx_Runtime_TPFLAGS_MAPPING == 0 && __Pyx_init_tpflags_bitcount(mapping_flags) == 1) {
1232 __Pyx_Runtime_TPFLAGS_MAPPING = mapping_flags;
1233 }
1234 }
1235 cleanup:
1236 Py_XDECREF(mapping);
1237 Py_XDECREF(sequence);
1238 Py_DECREF(collections_abc);
1239 return result;
1240#if __PYX_LIMITED_VERSION_HEX < 0x030D0000
1241 fail_attr_lookup:
1242 if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
1243 PyErr_Clear();
1244 }
1245#endif
1246 fail:
1247 result = PyErr_Occurred() ? -1 : 0;
1248 goto cleanup;
1249}
1250#else
1251static int __Pyx_init_co_variables(void) {
1252 return 0; // It's a limited API-only feature
1253}
1254static int __Pyx_init_tpflags_variables(void) {
1255 return 0; // It's a limited API-only feature
1256}
1257#endif
1258
1259/* MathInitCode */
1260#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
1261 #ifndef _USE_MATH_DEFINES
1262 #define _USE_MATH_DEFINES
1263 #endif
1264#endif
1265#include <math.h>
1266#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
1267#define __Pyx_truncl trunc
1268#else
1269#define __Pyx_truncl truncl
1270#endif
1271
1272#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME
1273#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 1
1274#endif
1275#ifndef CYTHON_CLINE_IN_TRACEBACK
1276#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME
1277#endif
1278#if CYTHON_CLINE_IN_TRACEBACK
1279#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; __pyx_clineno = __LINE__; (void) __pyx_clineno; }
1280#else
1281#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; (void) __pyx_clineno; }
1282#endif
1283#define __PYX_ERR(f_index, lineno, Ln_error) \
1284 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
1285
1286#ifdef CYTHON_EXTERN_C
1287 #undef __PYX_EXTERN_C
1288 #define __PYX_EXTERN_C CYTHON_EXTERN_C
1289#elif defined(__PYX_EXTERN_C)
1290 #ifdef _MSC_VER
1291 #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
1292 #else
1293 #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
1294 #endif
1295#else
1296 #define __PYX_EXTERN_C extern "C++"
1297#endif
1298
1299#define __PYX_HAVE__fenton__Fenton
1300#define __PYX_HAVE_API__fenton__Fenton
1301/* Early includes */
1302#include <string.h>
1303#include <stdio.h>
1304
1305 /* Using NumPy API declarations from "numpy/__init__.cython-30.pxd" */
1306
1307#include "numpy/arrayobject.h"
1308#include "numpy/ndarrayobject.h"
1309#include "numpy/ndarraytypes.h"
1310#include "numpy/arrayscalars.h"
1311#include "numpy/ufuncobject.h"
1312#include "Fourier.cpp"
1313#ifdef _OPENMP
1314#include <omp.h>
1315#endif /* _OPENMP */
1316
1317#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
1318#define CYTHON_WITHOUT_ASSERTIONS
1319#endif
1320
1321#ifdef CYTHON_FREETHREADING_COMPATIBLE
1322#if CYTHON_FREETHREADING_COMPATIBLE
1323#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_NOT_USED
1324#else
1325#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
1326#endif
1327#else
1328#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
1329#endif
1330#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
1331#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
1332#define __PYX_DEFAULT_STRING_ENCODING ""
1333#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
1334#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1335#define __Pyx_uchar_cast(c) ((unsigned char)c)
1336#define __Pyx_long_cast(x) ((long)x)
1337#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
1338 (sizeof(type) < sizeof(Py_ssize_t)) ||\
1339 (sizeof(type) > sizeof(Py_ssize_t) &&\
1340 likely(v < (type)PY_SSIZE_T_MAX ||\
1341 v == (type)PY_SSIZE_T_MAX) &&\
1342 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
1343 v == (type)PY_SSIZE_T_MIN))) ||\
1344 (sizeof(type) == sizeof(Py_ssize_t) &&\
1345 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
1346 v == (type)PY_SSIZE_T_MAX))) )
1347static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
1348 return (size_t) i < (size_t) limit;
1349}
1350#if defined (__cplusplus) && __cplusplus >= 201103L
1351 #include <cstdlib>
1352 #define __Pyx_sst_abs(value) std::abs(value)
1353#elif SIZEOF_INT >= SIZEOF_SIZE_T
1354 #define __Pyx_sst_abs(value) abs(value)
1355#elif SIZEOF_LONG >= SIZEOF_SIZE_T
1356 #define __Pyx_sst_abs(value) labs(value)
1357#elif defined (_MSC_VER)
1358 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
1359#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
1360 #define __Pyx_sst_abs(value) llabs(value)
1361#elif defined (__GNUC__)
1362 #define __Pyx_sst_abs(value) __builtin_llabs(value)
1363#else
1364 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
1365#endif
1366static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s);
1367static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
1368static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
1369static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
1370#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
1371#define __Pyx_PyBytes_FromString PyBytes_FromString
1372#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
1373static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
1374#if CYTHON_ASSUME_SAFE_MACROS
1375 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
1376 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
1377 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
1378 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
1379 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
1380 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
1381 #define __Pyx_PyByteArray_AsString(s) PyByteArray_AS_STRING(s)
1382#else
1383 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AsString(s))
1384 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AsString(s))
1385 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AsString(s))
1386 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AsString(s))
1387 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AsString(s))
1388 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AsString(s))
1389 #define __Pyx_PyByteArray_AsString(s) PyByteArray_AsString(s)
1390#endif
1391#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1392#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1393#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1394#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
1395#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
1396#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
1397#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
1398#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
1399#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
1400#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o)
1401#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
1402static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) {
1403#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef)
1404 return Py_NewRef(obj);
1405#else
1406 Py_INCREF(obj);
1407 return obj;
1408#endif
1409}
1410static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) {
1411#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef)
1412 return Py_XNewRef(obj);
1413#else
1414 Py_XINCREF(obj);
1415 return obj;
1416#endif
1417}
1418static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b);
1419static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
1420static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
1421static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
1422static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x);
1423#define __Pyx_PyObject_RichCompareBool(a,b,cmp) __Pyx_PyObject_IsTrueAndDecref(PyObject_RichCompare((a),(b),(cmp)))
1424#define __Pyx_PySequence_Tuple(obj)\
1425 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
1426static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
1427static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t);
1428static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
1429#if CYTHON_ASSUME_SAFE_MACROS
1430#define __Pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
1431#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x)
1432#define __Pyx_PyFloat_IsNonZero(x) (PyFloat_AS_DOUBLE(x) != 0.0)
1433#else
1434#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
1435#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x)
1436#define __Pyx_PyFloat_IsNonZero(x) PyObject_IsTrue(x)
1437#endif
1438#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x))
1439#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
1440#if CYTHON_USE_PYLONG_INTERNALS
1441 #if PY_VERSION_HEX >= 0x030C00A7
1442 #ifndef _PyLong_SIGN_MASK
1443 #define _PyLong_SIGN_MASK 3
1444 #endif
1445 #ifndef _PyLong_NON_SIZE_BITS
1446 #define _PyLong_NON_SIZE_BITS 3
1447 #endif
1448 #define __Pyx_PyLong_SignBits(x) ((int) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK))
1449 #define __Pyx_PyLong_Sign(x) (1 - __Pyx_PyLong_SignBits(x))
1450 #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_SignBits(x) & 2) != 0)
1451 #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x))
1452 #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_SignBits(x) & 1)
1453 #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_SignBits(x) == 0)
1454 #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0])
1455 #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
1456 #define __Pyx_PyLong_SignedDigitCount(x)\
1457 (((Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
1458 #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
1459 #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x)
1460 #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x)
1461 #else
1462 #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
1463 #define __Pyx_PyLong_CompactValue(x) (((Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
1464 #endif
1465 static CYTHON_INLINE Py_ssize_t __Pyx_PyLong_CompareSignAndSize(PyObject *a, PyObject *b) {
1466 uintptr_t tag_a = ((PyLongObject*)a)->long_value.lv_tag;
1467 uintptr_t tag_b = ((PyLongObject*)b)->long_value.lv_tag;
1468 if (tag_a == tag_b) return 0;
1469 int sign_a = (int) (tag_a & _PyLong_SIGN_MASK);
1470 int sign_b = (int) (tag_b & _PyLong_SIGN_MASK);
1471 if (sign_a > sign_b) return -1;
1472 if (sign_a < sign_b) return 1;
1473 Py_ssize_t size_a = (Py_ssize_t) (tag_a >> _PyLong_NON_SIZE_BITS);
1474 Py_ssize_t size_b = (Py_ssize_t) (tag_b >> _PyLong_NON_SIZE_BITS);
1475 return (1 - sign_a) * (size_a - size_b);
1476 }
1477 typedef Py_ssize_t __Pyx_compact_pylong;
1478 typedef size_t __Pyx_compact_upylong;
1479 #else
1480 #define __Pyx_PyLong_Sign(x) ((int) ((Py_SIZE(x) == 0) ? 0 : (Py_SIZE(x) < 0) ? -1 : 1))
1481 #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0)
1482 #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0)
1483 #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0)
1484 #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0)
1485 #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
1486 #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x))
1487 #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x)
1488 #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
1489 #define __Pyx_PyLong_CompactValue(x)\
1490 ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
1491 #define __Pyx_PyLong_CompareSignAndSize(a, b) (Py_SIZE(a) - Py_SIZE(b))
1492 typedef sdigit __Pyx_compact_pylong;
1493 typedef digit __Pyx_compact_upylong;
1494 #endif
1495 #if PY_VERSION_HEX >= 0x030C00A5
1496 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit)
1497 #else
1498 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit)
1499 #endif
1500 #define __Pyx_PyLong_IsNonZero(x) (!__Pyx_PyLong_IsZero(x))
1501#else
1502 #define __Pyx_PyLong_IsNonZero(x) PyObject_IsTrue(x)
1503#endif
1504#if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
1505 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
1506#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1507 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL)
1508#else
1509 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
1510#endif
1511
1512
1513/* Test for GCC > 2.95 */
1514#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
1515 #define likely(x) __builtin_expect(!!(x), 1)
1516 #define unlikely(x) __builtin_expect(!!(x), 0)
1517#else /* !__GNUC__ or GCC < 2.95 */
1518 #define likely(x) (x)
1519 #define unlikely(x) (x)
1520#endif /* __GNUC__ */
1521/* PretendToInitialize */
1522#ifdef __cplusplus
1523#if __cplusplus > 201103L
1524#include <type_traits>
1525#endif
1526template <typename T>
1527static void __Pyx_pretend_to_initialize(T* ptr) {
1528#if __cplusplus > 201103L
1529 if ((std::is_trivially_default_constructible<T>::value))
1530#endif
1531 *ptr = T();
1532 (void)ptr;
1533}
1534#else
1535static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
1536#endif
1537
1538
1539#if !CYTHON_USE_MODULE_STATE
1540static PyObject *__pyx_m = NULL;
1541#endif
1542static const char * const __pyx_cfilenm = __FILE__;
1543
1544/* Header.proto */
1545#if !defined(CYTHON_CCOMPLEX)
1546 #if defined(__cplusplus)
1547 #define CYTHON_CCOMPLEX 1
1548 #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__) && !defined(_MSC_VER))
1549 #define CYTHON_CCOMPLEX 1
1550 #else
1551 #define CYTHON_CCOMPLEX 0
1552 #endif
1553#endif
1554#if CYTHON_CCOMPLEX
1555 #ifdef __cplusplus
1556 #include <complex>
1557 #else
1558 #include <complex.h>
1559 #endif
1560#endif
1561#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
1562 #undef _Complex_I
1563 #define _Complex_I 1.0fj
1564#endif
1565
1566/* #### Code section: filename_table ### */
1567
1568static const char* const __pyx_f[] = {
1569 "proteus/fenton/Fenton.pyx",
1570 "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd",
1571 "cpython/type.pxd",
1572};
1573/* #### Code section: utility_code_proto_before_types ### */
1574/* Atomics.proto (used by UnpackUnboundCMethod) */
1575#include <pythread.h>
1576#ifndef CYTHON_ATOMICS
1577 #define CYTHON_ATOMICS 1
1578#endif
1579#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
1580#define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1581#define __pyx_atomic_int_type int
1582#define __pyx_nonatomic_int_type int
1583#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1584 (__STDC_VERSION__ >= 201112L) &&\
1585 !defined(__STDC_NO_ATOMICS__))
1586 #include <stdatomic.h>
1587#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1588 (__cplusplus >= 201103L) ||\
1589 (defined(_MSC_VER) && _MSC_VER >= 1700)))
1590 #include <atomic>
1591#endif
1592#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1593 (__STDC_VERSION__ >= 201112L) &&\
1594 !defined(__STDC_NO_ATOMICS__) &&\
1595 ATOMIC_INT_LOCK_FREE == 2)
1596 #undef __pyx_atomic_int_type
1597 #define __pyx_atomic_int_type atomic_int
1598 #define __pyx_atomic_ptr_type atomic_uintptr_t
1599 #define __pyx_nonatomic_ptr_type uintptr_t
1600 #define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed)
1601 #define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel)
1602 #define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel)
1603 #define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg)
1604 #define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
1605 #define __pyx_atomic_load(value) atomic_load(value)
1606 #define __pyx_atomic_store(value, new_value) atomic_store(value, new_value)
1607 #define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed)
1608 #define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire)
1609 #define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
1610 #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
1611 #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1612 #pragma message ("Using standard C atomics")
1613 #elif defined(__PYX_DEBUG_ATOMICS)
1614 #warning "Using standard C atomics"
1615 #endif
1616#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1617 (__cplusplus >= 201103L) ||\
1618\
1619 (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\
1620 ATOMIC_INT_LOCK_FREE == 2)
1621 #undef __pyx_atomic_int_type
1622 #define __pyx_atomic_int_type std::atomic_int
1623 #define __pyx_atomic_ptr_type std::atomic_uintptr_t
1624 #define __pyx_nonatomic_ptr_type uintptr_t
1625 #define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed)
1626 #define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel)
1627 #define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel)
1628 #define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg)
1629 #define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
1630 #define __pyx_atomic_load(value) std::atomic_load(value)
1631 #define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value)
1632 #define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed)
1633 #define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire)
1634 #define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
1635 #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
1636 #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1637 #pragma message ("Using standard C++ atomics")
1638 #elif defined(__PYX_DEBUG_ATOMICS)
1639 #warning "Using standard C++ atomics"
1640 #endif
1641#elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
1642 (__GNUC_MINOR__ > 1 ||\
1643 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
1644 #define __pyx_atomic_ptr_type void*
1645 #define __pyx_nonatomic_ptr_type void*
1646 #define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1)
1647 #define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1)
1648 #define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1)
1649 #define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg)
1650 static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
1651 __pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired);
1652 int result = old == *expected;
1653 *expected = old;
1654 return result;
1655 }
1656 #define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0)
1657 #define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value)
1658 #define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0)
1659 #define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0)
1660 #define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value)
1661 static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
1662 __pyx_nonatomic_ptr_type old = __sync_val_compare_and_swap(value, *expected, desired);
1663 int result = old == *expected;
1664 *expected = old;
1665 return result;
1666 }
1667 #ifdef __PYX_DEBUG_ATOMICS
1668 #warning "Using GNU atomics"
1669 #endif
1670#elif CYTHON_ATOMICS && defined(_MSC_VER)
1671 #include <intrin.h>
1672 #undef __pyx_atomic_int_type
1673 #define __pyx_atomic_int_type long
1674 #define __pyx_atomic_ptr_type void*
1675 #undef __pyx_nonatomic_int_type
1676 #define __pyx_nonatomic_int_type long
1677 #define __pyx_nonatomic_ptr_type void*
1678 #pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer)
1679 #define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1)
1680 #define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1)
1681 #define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1)
1682 #define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg)
1683 static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
1684 __pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected);
1685 int result = old == *expected;
1686 *expected = old;
1687 return result;
1688 }
1689 #define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0)
1690 #define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value)
1691 #define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value
1692 #define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0)
1693 #define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value)
1694 static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
1695 __pyx_atomic_ptr_type old = _InterlockedCompareExchangePointer(value, desired, *expected);
1696 int result = old == *expected;
1697 *expected = old;
1698 return result;
1699 }
1700 #ifdef __PYX_DEBUG_ATOMICS
1701 #pragma message ("Using MSVC atomics")
1702 #endif
1703#else
1704 #undef CYTHON_ATOMICS
1705 #define CYTHON_ATOMICS 0
1706 #ifdef __PYX_DEBUG_ATOMICS
1707 #warning "Not using atomics"
1708 #endif
1709#endif
1710
1711/* CriticalSectionsDefinition.proto (used by CriticalSections) */
1712#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1713#define __Pyx_PyCriticalSection void*
1714#define __Pyx_PyCriticalSection2 void*
1715#define __Pyx_PyCriticalSection_End(cs)
1716#define __Pyx_PyCriticalSection2_End(cs)
1717#else
1718#define __Pyx_PyCriticalSection PyCriticalSection
1719#define __Pyx_PyCriticalSection2 PyCriticalSection2
1720#define __Pyx_PyCriticalSection_End PyCriticalSection_End
1721#define __Pyx_PyCriticalSection2_End PyCriticalSection2_End
1722#endif
1723
1724/* CriticalSections.proto (used by ParseKeywordsImpl) */
1725#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1726#define __Pyx_PyCriticalSection_Begin(cs, arg) (void)(cs)
1727#define __Pyx_PyCriticalSection2_Begin(cs, arg1, arg2) (void)(cs)
1728#else
1729#define __Pyx_PyCriticalSection_Begin PyCriticalSection_Begin
1730#define __Pyx_PyCriticalSection2_Begin PyCriticalSection2_Begin
1731#endif
1732#if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
1733#define __Pyx_BEGIN_CRITICAL_SECTION(o) {
1734#define __Pyx_END_CRITICAL_SECTION() }
1735#else
1736#define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION
1737#define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION
1738#endif
1739
1740/* IncludeStructmemberH.proto (used by CythonFunctionShared) */
1741#include <structmember.h>
1742
1743/* #### Code section: numeric_typedefs ### */
1744
1745/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":761
1746 * # in Cython to enable them only on the right systems.
1747 *
1748 * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
1749 * ctypedef npy_int16 int16_t
1750 * ctypedef npy_int32 int32_t
1751*/
1752typedef npy_int8 __pyx_t_5numpy_int8_t;
1753
1754/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":762
1755 *
1756 * ctypedef npy_int8 int8_t
1757 * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
1758 * ctypedef npy_int32 int32_t
1759 * ctypedef npy_int64 int64_t
1760*/
1761typedef npy_int16 __pyx_t_5numpy_int16_t;
1762
1763/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":763
1764 * ctypedef npy_int8 int8_t
1765 * ctypedef npy_int16 int16_t
1766 * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
1767 * ctypedef npy_int64 int64_t
1768 *
1769*/
1770typedef npy_int32 __pyx_t_5numpy_int32_t;
1771
1772/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":764
1773 * ctypedef npy_int16 int16_t
1774 * ctypedef npy_int32 int32_t
1775 * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
1776 *
1777 * ctypedef npy_uint8 uint8_t
1778*/
1779typedef npy_int64 __pyx_t_5numpy_int64_t;
1780
1781/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":766
1782 * ctypedef npy_int64 int64_t
1783 *
1784 * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
1785 * ctypedef npy_uint16 uint16_t
1786 * ctypedef npy_uint32 uint32_t
1787*/
1788typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1789
1790/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":767
1791 *
1792 * ctypedef npy_uint8 uint8_t
1793 * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1794 * ctypedef npy_uint32 uint32_t
1795 * ctypedef npy_uint64 uint64_t
1796*/
1797typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1798
1799/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":768
1800 * ctypedef npy_uint8 uint8_t
1801 * ctypedef npy_uint16 uint16_t
1802 * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1803 * ctypedef npy_uint64 uint64_t
1804 *
1805*/
1806typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1807
1808/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":769
1809 * ctypedef npy_uint16 uint16_t
1810 * ctypedef npy_uint32 uint32_t
1811 * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1812 *
1813 * ctypedef npy_float32 float32_t
1814*/
1815typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1816
1817/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":771
1818 * ctypedef npy_uint64 uint64_t
1819 *
1820 * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1821 * ctypedef npy_float64 float64_t
1822 * #ctypedef npy_float80 float80_t
1823*/
1824typedef npy_float32 __pyx_t_5numpy_float32_t;
1825
1826/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":772
1827 *
1828 * ctypedef npy_float32 float32_t
1829 * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1830 * #ctypedef npy_float80 float80_t
1831 * #ctypedef npy_float128 float128_t
1832*/
1833typedef npy_float64 __pyx_t_5numpy_float64_t;
1834
1835/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":779
1836 * ctypedef double complex complex128_t
1837 *
1838 * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1839 * ctypedef npy_ulonglong ulonglong_t
1840 *
1841*/
1842typedef npy_longlong __pyx_t_5numpy_longlong_t;
1843
1844/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":780
1845 *
1846 * ctypedef npy_longlong longlong_t
1847 * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1848 *
1849 * ctypedef npy_intp intp_t
1850*/
1851typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1852
1853/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":782
1854 * ctypedef npy_ulonglong ulonglong_t
1855 *
1856 * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1857 * ctypedef npy_uintp uintp_t
1858 *
1859*/
1860typedef npy_intp __pyx_t_5numpy_intp_t;
1861
1862/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":783
1863 *
1864 * ctypedef npy_intp intp_t
1865 * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1866 *
1867 * ctypedef npy_double float_t
1868*/
1869typedef npy_uintp __pyx_t_5numpy_uintp_t;
1870
1871/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":785
1872 * ctypedef npy_uintp uintp_t
1873 *
1874 * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1875 * ctypedef npy_double double_t
1876 * ctypedef npy_longdouble longdouble_t
1877*/
1878typedef npy_double __pyx_t_5numpy_float_t;
1879
1880/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":786
1881 *
1882 * ctypedef npy_double float_t
1883 * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1884 * ctypedef npy_longdouble longdouble_t
1885 *
1886*/
1887typedef npy_double __pyx_t_5numpy_double_t;
1888
1889/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":787
1890 * ctypedef npy_double float_t
1891 * ctypedef npy_double double_t
1892 * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1893 *
1894 * ctypedef float complex cfloat_t
1895*/
1896typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1897/* #### Code section: complex_type_declarations ### */
1898/* Declarations.proto */
1899#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1900 #ifdef __cplusplus
1901 typedef ::std::complex< float > __pyx_t_float_complex;
1902 #else
1903 typedef float _Complex __pyx_t_float_complex;
1904 #endif
1905#else
1906 typedef struct { float real, imag; } __pyx_t_float_complex;
1907#endif
1908static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1909
1910/* Declarations.proto */
1911#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1912 #ifdef __cplusplus
1913 typedef ::std::complex< double > __pyx_t_double_complex;
1914 #else
1915 typedef double _Complex __pyx_t_double_complex;
1916 #endif
1917#else
1918 typedef struct { double real, imag; } __pyx_t_double_complex;
1919#endif
1920static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1921
1922/* Declarations.proto */
1923#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1924 #ifdef __cplusplus
1925 typedef ::std::complex< long double > __pyx_t_long_double_complex;
1926 #else
1927 typedef long double _Complex __pyx_t_long_double_complex;
1928 #endif
1929#else
1930 typedef struct { long double real, imag; } __pyx_t_long_double_complex;
1931#endif
1932static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double, long double);
1933
1934/* #### Code section: type_declarations ### */
1935
1936/*--- Type declarations ---*/
1937/* #### Code section: utility_code_proto ### */
1938
1939/* --- Runtime support code (head) --- */
1940/* Refnanny.proto */
1941#ifndef CYTHON_REFNANNY
1942 #define CYTHON_REFNANNY 0
1943#endif
1944#if CYTHON_REFNANNY
1945 typedef struct {
1946 void (*INCREF)(void*, PyObject*, Py_ssize_t);
1947 void (*DECREF)(void*, PyObject*, Py_ssize_t);
1948 void (*GOTREF)(void*, PyObject*, Py_ssize_t);
1949 void (*GIVEREF)(void*, PyObject*, Py_ssize_t);
1950 void* (*SetupContext)(const char*, Py_ssize_t, const char*);
1951 void (*FinishContext)(void**);
1952 } __Pyx_RefNannyAPIStruct;
1953 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1954 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1955 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1956 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1957 if (acquire_gil) {\
1958 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1959 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
1960 PyGILState_Release(__pyx_gilstate_save);\
1961 } else {\
1962 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
1963 }
1964 #define __Pyx_RefNannyFinishContextNogil() {\
1965 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1966 __Pyx_RefNannyFinishContext();\
1967 PyGILState_Release(__pyx_gilstate_save);\
1968 }
1969 #define __Pyx_RefNannyFinishContextNogil() {\
1970 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1971 __Pyx_RefNannyFinishContext();\
1972 PyGILState_Release(__pyx_gilstate_save);\
1973 }
1974 #define __Pyx_RefNannyFinishContext()\
1975 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1976 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
1977 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
1978 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
1979 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
1980 #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0)
1981 #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
1982 #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
1983 #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
1984#else
1985 #define __Pyx_RefNannyDeclarations
1986 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1987 #define __Pyx_RefNannyFinishContextNogil()
1988 #define __Pyx_RefNannyFinishContext()
1989 #define __Pyx_INCREF(r) Py_INCREF(r)
1990 #define __Pyx_DECREF(r) Py_DECREF(r)
1991 #define __Pyx_GOTREF(r)
1992 #define __Pyx_GIVEREF(r)
1993 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1994 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1995 #define __Pyx_XGOTREF(r)
1996 #define __Pyx_XGIVEREF(r)
1997#endif
1998#define __Pyx_Py_XDECREF_SET(r, v) do {\
1999 PyObject *tmp = (PyObject *) r;\
2000 r = v; Py_XDECREF(tmp);\
2001 } while (0)
2002#define __Pyx_XDECREF_SET(r, v) do {\
2003 PyObject *tmp = (PyObject *) r;\
2004 r = v; __Pyx_XDECREF(tmp);\
2005 } while (0)
2006#define __Pyx_DECREF_SET(r, v) do {\
2007 PyObject *tmp = (PyObject *) r;\
2008 r = v; __Pyx_DECREF(tmp);\
2009 } while (0)
2010#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
2011#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
2012
2013/* FastTypeChecks.proto (used by GivenExceptionMatches) */
2014#if CYTHON_COMPILING_IN_CPYTHON
2015#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2016#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
2017static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2018static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
2019#define __Pyx_PyAnySet_Check(obj) __Pyx_TypeCheck2(obj, &PySet_Type, &PyFrozenSet_Type)
2020#else
2021#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2022#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
2023#define __Pyx_PyAnySet_Check(obj) PyAnySet_Check(obj)
2024#endif
2025
2026/* PyThreadStateGet.proto (used by PyErrFetchRestore) */
2027#if CYTHON_FAST_THREAD_STATE
2028#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
2029#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
2030#if PY_VERSION_HEX >= 0x030C00A6
2031#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL)
2032#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
2033#else
2034#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL)
2035#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type)
2036#endif
2037#else
2038#define __Pyx_PyThreadState_declare
2039#define __Pyx_PyThreadState_assign
2040#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL)
2041#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred()
2042#endif
2043
2044/* PyErrFetchRestore.proto (used by GivenExceptionMatches) */
2045#if CYTHON_FAST_THREAD_STATE
2046#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
2047#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
2048#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
2049#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
2050#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
2051static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2052static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2053#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6
2054#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
2055#else
2056#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2057#endif
2058#else
2059#define __Pyx_PyErr_Clear() PyErr_Clear()
2060#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2061#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
2062#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
2063#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
2064#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
2065#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
2066#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
2067#endif
2068
2069/* GivenExceptionMatches.proto (used by PyErrExceptionMatches) */
2070#if CYTHON_COMPILING_IN_CPYTHON
2071static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2072static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2073#else
2074#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2075static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) {
2076 return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2);
2077}
2078#endif
2079#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
2080
2081/* PyErrExceptionMatches.proto (used by PyObjectGetAttrStrNoError) */
2082#if CYTHON_FAST_THREAD_STATE
2083#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2084static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2085#else
2086#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2087#endif
2088
2089/* PyObjectGetAttrStr.proto (used by PyObjectGetAttrStrNoError) */
2090#if CYTHON_USE_TYPE_SLOTS
2091static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
2092#else
2093#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
2094#endif
2095
2096/* PyObjectGetAttrStrNoError.proto (used by GetBuiltinName) */
2097static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2098
2099/* GetBuiltinName.proto */
2100static PyObject *__Pyx_GetBuiltinName(PyObject *name);
2101
2102/* GetTopmostException.proto (used by SaveResetException) */
2103#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
2104static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2105#endif
2106
2107/* SaveResetException.proto */
2108#if CYTHON_FAST_THREAD_STATE
2109#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2110static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2111#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2112static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2113#else
2114#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2115#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2116#endif
2117
2118/* PyException_Check.proto */
2119#define __Pyx_PyExc_Exception_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2120
2121/* GetException.proto */
2122#if CYTHON_FAST_THREAD_STATE
2123#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2124static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2125#else
2126static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2127#endif
2128
2129/* PyImportError_Check.proto */
2130#define __Pyx_PyExc_ImportError_Check(obj) __Pyx_TypeCheck(obj, PyExc_ImportError)
2131
2132/* PyObjectCall.proto (used by PyObjectFastCall) */
2133#if CYTHON_COMPILING_IN_CPYTHON
2134static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
2135#else
2136#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
2137#endif
2138
2139/* PyObjectCallMethO.proto (used by PyObjectFastCall) */
2140#if CYTHON_COMPILING_IN_CPYTHON
2141static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
2142#endif
2143
2144/* PyObjectFastCall.proto */
2145#define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
2146static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject * const*args, size_t nargsf, PyObject *kwargs);
2147
2148/* RaiseException.export */
2149static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2150
2151/* CopyObjectArray.proto (used by TupleOrListFromArrayImpl) */
2152#if CYTHON_COMPILING_IN_CPYTHON
2153static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length);
2154#endif
2155
2156/* TupleOrListFromArrayImpl.proto (used by TupleFromArray) */
2157#if PY_VERSION_HEX >= 0x030F0000 && !CYTHON_COMPILING_IN_LIMITED_API
2158#define __Pyx_PyTuple_FromArray(src, n) PyTuple_FromArray(src, ((n)<0) ? 0 : (n))
2159#else
2160CYTHON_UNUSED static PyObject *
2161__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
2162#endif
2163
2164/* TupleFromArray.proto (used by fastcall) */
2165
2166
2167/* IncludeStringH.proto (used by PyObjectCompare) */
2168#include <string.h>
2169
2170/* PyObjectCompare.proto (used by UnicodeEquals) */
2171static CYTHON_INLINE int __Pyx_PyObject_CompareBoolEq_str_str(PyObject *op1, PyObject *op2, int pyop);
2172
2173/* UnicodeEquals.proto (used by fastcall) */
2174#define __Pyx_PyUnicode_Equals(s1, s2) __Pyx_PyObject_CompareBoolEq_str_str(s1, s2, Py_EQ)
2175
2176/* fastcall.proto */
2177#if CYTHON_AVOID_BORROWED_REFS
2178 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i)
2179#elif CYTHON_ASSUME_SAFE_MACROS
2180 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i))
2181#else
2182 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i))
2183#endif
2184#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
2185#define __Pyx_KwValues_VARARGS(args, nargs) NULL
2186#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
2187#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
2188#if CYTHON_VECTORCALL
2189 #define __Pyx_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i])
2190 #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds)
2191 #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
2192 static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
2193 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL
2194 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
2195 #else
2196 #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
2197 #endif
2198#else
2199 #define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_VARARGS
2200 #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
2201 #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
2202 #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
2203 #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
2204#endif
2205#if CYTHON_VECTORCALL_TPNEW
2206 #if !CYTHON_VECTORCALL
2207 #error Enabling CYTHON_VECTORCALL_TPNEW without CYTHON_VECTORCALL is not supported
2208 #endif
2209 #define __Pyx_ArgRef_FASTCALL_TPNEW __Pyx_ArgRef_FASTCALL
2210 #define __Pyx_NumKwargs_FASTCALL_TPNEW __Pyx_NumKwargs_FASTCALL
2211 #define __Pyx_KwValues_FASTCALL_TPNEW __Pyx_KwValues_FASTCALL
2212 #define __Pyx_GetKwValue_FASTCALL_TPNEW __Pyx_GetKwValue_FASTCALL
2213 #define __Pyx_KwargsAsDict_FASTCALL_TPNEW __Pyx_KwargsAsDict_FASTCALL
2214#else
2215 #define __Pyx_ArgRef_FASTCALL_TPNEW __Pyx_ArgRef_VARARGS
2216 #define __Pyx_NumKwargs_FASTCALL_TPNEW __Pyx_NumKwargs_VARARGS
2217 #define __Pyx_KwValues_FASTCALL_TPNEW __Pyx_KwValues_VARARGS
2218 #define __Pyx_GetKwValue_FASTCALL_TPNEW __Pyx_GetKwValue_VARARGS
2219 #define __Pyx_KwargsAsDict_FASTCALL_TPNEW __Pyx_KwargsAsDict_VARARGS
2220#endif
2221#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
2222#if CYTHON_VECTORCALL
2223#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start)
2224#else
2225#define __Pyx_ArgsSlice_FASTCALL __Pyx_ArgsSlice_VARARGS
2226#endif
2227
2228/* py_dict_items.proto (used by OwnedDictNext) */
2229#define __Pyx_PyDict_items_TypePtr (&PyDictKeys_Type)
2230#define __Pyx_PyDict_items_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyDictItems_TypePtr)
2231#define __Pyx_PyDict_items_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyDictItems_TypePtr)
2232static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d);
2233
2234/* CallCFunction.proto (used by CallUnboundCMethod0) */
2235#define __Pyx_CallCFunction(cfunc, self, args)\
2236 ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args)
2237#define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\
2238 ((PyCFunctionWithKeywords)(void(*)(void))(cfunc)->func)(self, args, kwargs)
2239#define __Pyx_CallCFunctionFast(cfunc, self, args, nargs)\
2240 ((__Pyx_PyCFunctionFast)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs)
2241#define __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, nargs, kwnames)\
2242 ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs, kwnames)
2243
2244/* PyObjectCallOneArg.proto (used by CallUnboundCMethod0) */
2245static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
2246
2247/* UnpackUnboundCMethod_decl.proto (used by UnpackUnboundCMethod) */
2248typedef struct {
2249 PyObject *type;
2250 PyObject **method_name;
2251 PyCFunction func;
2252 PyObject *method;
2253 int flag;
2254#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS
2255 __pyx_atomic_int_type initialized;
2256#endif
2257} __Pyx_CachedCFunction;
2258
2259/* IgnoreException.proto (used by UnpackUnboundCMethod_impl) */
2260static CYTHON_INLINE int __Pyx_IgnoreGivenException(PyObject *given_exception, PyObject *ignorable_exception);
2261#define __Pyx_IgnoreException(ignorable_exception) __Pyx_IgnoreGivenException(NULL, ignorable_exception)
2262
2263/* UnpackUnboundCMethod_impl.export */
2264static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target);
2265
2266/* UnpackUnboundCMethod.proto (used by CallUnboundCMethod0) */
2267#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
2268static CYTHON_INLINE int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) {
2269#if !CYTHON_ATOMICS
2270 return 1;
2271#else
2272 __pyx_nonatomic_int_type expected = 0;
2273 if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) {
2274 return 0;
2275 }
2276 return expected;
2277#endif
2278}
2279static CYTHON_INLINE void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) {
2280#if CYTHON_ATOMICS
2281 __pyx_atomic_store(&cfunc->initialized, 2);
2282#endif
2283}
2284#else
2285#define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2
2286#define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc)
2287#endif
2288
2289/* CallUnboundCMethod0.proto */
2290CYTHON_UNUSED
2291static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
2292#if CYTHON_COMPILING_IN_CPYTHON
2293static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
2294#else
2295#define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self)
2296#endif
2297
2298/* py_dict_values.proto (used by OwnedDictNext) */
2299#define __Pyx_PyDict_values_TypePtr (&PyDictKeys_Type)
2300#define __Pyx_PyDict_values_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyDictValues_TypePtr)
2301#define __Pyx_PyDict_values_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyDictValues_TypePtr)
2302static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d);
2303
2304/* OwnedDictNext.proto (used by ParseKeywordsImpl) */
2305#if CYTHON_AVOID_BORROWED_REFS
2306static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue);
2307#else
2308CYTHON_INLINE
2309static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue);
2310#endif
2311
2312/* RaiseDoubleKeywords.proto (used by ParseKeywordsImpl) */
2313static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
2314
2315/* ParseKeywordsImpl.export */
2316static int __Pyx_ParseKeywordsTuple(
2317 PyObject *kwds,
2318 PyObject * const *kwvalues,
2319 PyObject ** const argnames[],
2320 PyObject *kwds2,
2321 PyObject *values[],
2322 Py_ssize_t num_pos_args,
2323 Py_ssize_t num_kwargs,
2324 const char* function_name,
2325 int ignore_unknown_kwargs
2326);
2327static int __Pyx_ParseKeywordDictToDict(
2328 PyObject *kwds,
2329 PyObject ** const argnames[],
2330 PyObject *kwds2,
2331 PyObject *values[],
2332 Py_ssize_t num_pos_args,
2333 const char* function_name
2334);
2335static int __Pyx_ParseKeywordDict(
2336 PyObject *kwds,
2337 PyObject ** const argnames[],
2338 PyObject *values[],
2339 Py_ssize_t num_pos_args,
2340 Py_ssize_t num_kwargs,
2341 const char* function_name,
2342 int ignore_unknown_kwargs
2343);
2344
2345/* CallUnboundCMethod2.proto */
2346CYTHON_UNUSED
2347static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
2348#if CYTHON_COMPILING_IN_CPYTHON
2349static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
2350#else
2351#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
2352#endif
2353
2354/* ParseKeywords.proto */
2355static CYTHON_INLINE int __Pyx_ParseKeywords(
2356 PyObject *kwds, PyObject *const *kwvalues, PyObject ** const argnames[],
2357 PyObject *kwds2, PyObject *values[],
2358 Py_ssize_t num_pos_args, Py_ssize_t num_kwargs,
2359 const char* function_name,
2360 int ignore_unknown_kwargs
2361);
2362
2363/* RaiseArgTupleInvalid.export */
2364static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
2365 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
2366
2367/* AssertionsEnabled.proto */
2368#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000
2369 static int __pyx_assertions_enabled_flag;
2370 #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
2371 #if __clang__ || __GNUC__
2372 __attribute__((no_sanitize("thread")))
2373 #endif
2374 static int __Pyx_init_assertions_enabled(void) {
2375 PyObject *builtins, *debug, *debug_str;
2376 int flag;
2377 builtins = PyEval_GetBuiltins();
2378 if (!builtins) goto bad;
2379 debug_str = PyUnicode_FromStringAndSize("__debug__", 9);
2380 if (!debug_str) goto bad;
2381 debug = PyObject_GetItem(builtins, debug_str);
2382 Py_DECREF(debug_str);
2383 if (!debug) goto bad;
2384 flag = PyObject_IsTrue(debug);
2385 Py_DECREF(debug);
2386 if (flag == -1) goto bad;
2387 __pyx_assertions_enabled_flag = flag;
2388 return 0;
2389 bad:
2390 __pyx_assertions_enabled_flag = 1;
2391 return -1;
2392 }
2393#else
2394 #define __Pyx_init_assertions_enabled() (0)
2395 #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2396#endif
2397
2398/* PyAssertionError_Check.proto */
2399#define __Pyx_PyExc_AssertionError_Check(obj) __Pyx_TypeCheck(obj, PyExc_AssertionError)
2400
2401/* PyObjectLookupSpecial.proto */
2402#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
2403#define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0)
2404#define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1)
2405static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error);
2406#else
2407#define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n)
2408#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
2409#endif
2410
2411/* PyObjectCompare.proto */
2412static CYTHON_INLINE int __Pyx_PyObject_CompareBoolEq_object_str(PyObject *op1, PyObject *op2, int pyop);
2413
2414/* PyDictVersioning.proto (used by GetModuleGlobalName) */
2415#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
2416#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
2417#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
2418#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
2419 (version_var) = __PYX_GET_DICT_VERSION(dict);\
2420 (cache_var) = (value);
2421#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
2422 static PY_UINT64_T __pyx_dict_version = 0;\
2423 static PyObject *__pyx_dict_cached_value = NULL;\
2424 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
2425 (VAR) = __Pyx_XNewRef(__pyx_dict_cached_value);\
2426 } else {\
2427 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
2428 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
2429 }\
2430}
2431static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
2432static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
2433static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
2434#else
2435#define __PYX_GET_DICT_VERSION(dict) (0)
2436#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
2437#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
2438#endif
2439
2440/* GetModuleGlobalName.proto */
2441#if CYTHON_USE_DICT_VERSIONS
2442#define __Pyx_GetModuleGlobalName(var, name) do {\
2443 static PY_UINT64_T __pyx_dict_version = 0;\
2444 static PyObject *__pyx_dict_cached_value = NULL;\
2445 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_mstate_global->__pyx_d))) ?\
2446 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
2447 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2448} while(0)
2449#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
2450 PY_UINT64_T __pyx_dict_version;\
2451 PyObject *__pyx_dict_cached_value;\
2452 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2453} while(0)
2454static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
2455#else
2456#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2457#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2458static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
2459#endif
2460
2461/* FormatTypeName.proto (used by RaiseErrorWithObjectTypes) */
2462#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030d0000
2463typedef PyObject *__Pyx_TypeName;
2464#define __Pyx_FMT_TYPENAME "%N"
2465#define __Pyx_PyType_GetFullyQualifiedName(tp) Py_NewRef((PyObject*)tp)
2466#define __Pyx_DECREF_TypeName(obj) Py_DECREF(obj)
2467#elif CYTHON_COMPILING_IN_LIMITED_API
2468typedef PyObject *__Pyx_TypeName;
2469#define __Pyx_FMT_TYPENAME "%U"
2470#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
2471static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp);
2472#else // !LIMITED_API
2473typedef const char *__Pyx_TypeName;
2474#define __Pyx_FMT_TYPENAME "%.200s"
2475#define __Pyx_PyType_GetFullyQualifiedName(tp) ((tp)->tp_name)
2476#define __Pyx_DECREF_TypeName(obj)
2477#endif
2478
2479/* RaiseErrorWithObjectTypes.proto (used by PyNumberBinop) */
2480#define __Pyx_RaiseErrorWithObjectTypes1(exc_type, message, arg, obj1, obj2) __Pyx_RaiseErrorWithTypes1(exc_type, message, arg, Py_TYPE(obj1), Py_TYPE(obj2))
2481#define __Pyx_RaiseTypeErrorWithObjectTypes(message, obj1, obj2) __Pyx_RaiseTypeErrorWithTypes(message, Py_TYPE(obj1), Py_TYPE(obj2))
2482#define __Pyx_RaiseTypeErrorWithTypes(message, type_obj1, type_obj2) __Pyx_RaiseErrorWithTypes1(PyExc_TypeError, "%.1s" message, "", type_obj1, type_obj2)
2483CYTHON_UNUSED
2484static void __Pyx_RaiseErrorWithTypes1(PyObject* exc_type, const char *message, const char *arg, PyTypeObject *type_obj1, PyTypeObject *type_obj2);
2485
2486/* PyNumberBinop.proto */
2487#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API
2488#define __Pyx_PyNumber_Multiply_object_object(op1, op2) PyNumber_Multiply(op1, op2)
2489#define __Pyx_PyNumber_InPlaceMultiply_object_object(op1, op2) PyNumber_InPlaceMultiply(op1, op2)
2490#else
2491#define __Pyx_PyNumber_Multiply_object_object(op1, op2) __Pyx__PyNumber_Multiply_object_object(op1, op2, 0)
2492#define __Pyx_PyNumber_InPlaceMultiply_object_object(op1, op2) __Pyx__PyNumber_Multiply_object_object(op1, op2, 1)
2493static CYTHON_INLINE PyObject* __Pyx__PyNumber_Multiply_object_object(PyObject *op1, PyObject *op2, int inplace);
2494#endif
2495
2496/* RaiseUnboundLocalError.proto */
2497static void __Pyx_RaiseUnboundLocalError(const char *varname);
2498
2499/* PyObjectVectorcallKwds.proto (used by PyObjectVectorcallMethodKwds) */
2500#if CYTHON_VECTORCALL
2501#define __Pyx_Object_VectorcallKwds PyObject_Vectorcall
2502CYTHON_UNUSED static int __Pyx_CheckVectorcallKwarg(PyObject *kwnames, Py_ssize_t i);
2503#else
2504#define __Pyx_Object_VectorcallKwds __Pyx_PyObject_FastCallDict
2505CYTHON_UNUSED static PyObject *__Pyx_MakeKwargDict(PyObject **keys, PyObject **values, Py_ssize_t n);
2506CYTHON_UNUSED static int __Pyx_CheckVectorcallKwarg(PyObject **kwnames, Py_ssize_t i);
2507#endif
2508
2509/* PyObjectVectorcallMethodKwds.proto */
2510#if CYTHON_VECTORCALL
2511#define __Pyx_Object_VectorcallMethodKwds PyObject_VectorcallMethod
2512#else
2513static PyObject *__Pyx_Object_VectorcallMethodKwds(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames);
2514#endif
2515
2516/* RaiseErrorWithObjectType1.proto (used by RaiseUnexpectedTypeError) */
2517#define __Pyx_RaiseTypeErrorWithObjectType1(message, arg, obj) __Pyx_RaiseErrorWithObjectType1(PyExc_TypeError, message, arg, obj)
2518#define __Pyx_RaiseErrorWithObjectType1(exc_type, message, arg, obj) __Pyx_RaiseErrorWithType1(exc_type, message, arg, Py_TYPE(obj))
2519CYTHON_UNUSED
2520static void __Pyx_RaiseErrorWithType1(PyObject* exc_type, const char* message, const char *arg, PyTypeObject *type_obj);
2521
2522/* RaiseUnexpectedTypeError.proto */
2523CYTHON_UNUSED
2524static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj);
2525
2526/* PyObjectFastCallMethod.proto */
2527#if CYTHON_VECTORCALL
2528#define __Pyx_PyObject_FastCallMethod(name, args, nargsf) PyObject_VectorcallMethod(name, args, nargsf, NULL)
2529#else
2530static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf);
2531#endif
2532
2533/* PyFrozenDict.proto (used by GetItemInt) */
2534#if CYTHON_COMPILING_IN_LIMITED_API
2535#define __Pyx_PyFrozenDict_TypePtr ((PyTypeObject*) __pyx_mstate_global->__Pyx_PyFrozenDictType)
2536#define __Pyx_PyFrozenDict_New(it) __Pyx__PyFrozenDict_New(__pyx_mstate_global->__Pyx_PyFrozenDictType, it)
2537static CYTHON_INLINE PyObject* __Pyx__PyFrozenDict_New(PyObject* frozendict_type, PyObject* it);
2538#define __Pyx_PyFrozenDict_NewEmpty() __Pyx_PyFrozenDict_New(NULL)
2539#define __Pyx_PyFrozenDict_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyFrozenDict_TypePtr)
2540#define __Pyx_PyFrozenDict_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyFrozenDict_TypePtr)
2541#define __Pyx_PyAnyDict_Check(obj) __Pyx__PyAnyDict_Check(obj, __Pyx_PyFrozenDict_TypePtr)
2542static CYTHON_INLINE int __Pyx__PyAnyDict_Check(PyObject *obj, PyTypeObject* frozendict_type) {
2543 return PyObject_TypeCheck(obj, &PyDict_Type) || PyObject_TypeCheck(obj, frozendict_type);
2544}
2545#define __Pyx_PyAnyDict_CheckExact(obj) __Pyx__PyAnyDict_CheckExact(obj, __Pyx_PyFrozenDict_TypePtr)
2546static CYTHON_INLINE int __Pyx__PyAnyDict_CheckExact(PyObject *obj, PyTypeObject* frozendict_type) {
2547 return Py_IS_TYPE(obj, &PyDict_Type) || Py_IS_TYPE(obj, frozendict_type);
2548}
2549#elif PY_VERSION_HEX >= 0x030f00a6 ||\
2550 (defined(PyFrozenDict_Check) && defined(PyAnyDict_Check) && defined(PyFrozenDict_New))
2551#define __Pyx_PyFrozenDict_TypePtr (&PyFrozenDict_Type)
2552#define __Pyx_PyFrozenDict_New(it) PyFrozenDict_New(it)
2553#define __Pyx_PyFrozenDict_NewEmpty() PyFrozenDict_New(NULL)
2554#define __Pyx_PyFrozenDict_Check(obj) PyFrozenDict_Check(obj)
2555#define __Pyx_PyFrozenDict_CheckExact(obj) PyFrozenDict_CheckExact(obj)
2556#define __Pyx_PyAnyDict_Check(obj) PyAnyDict_Check(obj)
2557#define __Pyx_PyAnyDict_CheckExact(obj) PyAnyDict_CheckExact(obj)
2558#else
2559#define __Pyx_PyFrozenDict_TypePtr (&PyDict_Type)
2560static CYTHON_INLINE PyObject* __Pyx_PyFrozenDict_New(PyObject* it) {
2561 if (!it) {
2562 return PyDict_New();
2563 } else if (PyDict_Check(it)) {
2564 return PyDict_Copy(it);
2565 } else {
2566 PyObject *dict = PyDict_New();
2567 if (!dict) return NULL;
2568 PyObject *result = PyNumber_InPlaceOr(dict, it);
2569 Py_DECREF(dict);
2570 return result;
2571 }
2572}
2573#define __Pyx_PyFrozenDict_NewEmpty() PyDict_New()
2574#define __Pyx_PyFrozenDict_Check(obj) PyDict_Check(obj)
2575#define __Pyx_PyFrozenDict_CheckExact(obj) PyDict_CheckExact(obj)
2576#define __Pyx_PyAnyDict_Check(obj) PyDict_Check(obj)
2577#define __Pyx_PyAnyDict_CheckExact(obj) PyDict_CheckExact(obj)
2578#endif
2579
2580/* GetItemInt.proto */
2581#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
2582 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2583 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
2584 __Pyx_GetItemInt_Generic(o, to_py_func(i)))
2585#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
2586 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2587 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
2588 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
2589static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
2590 int wraparound, int boundscheck, int unsafe_shared);
2591#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
2592 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2593 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
2594 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
2595static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
2596 int wraparound, int boundscheck, int unsafe_shared);
2597static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
2598static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
2599 int wraparound, int boundscheck, int unsafe_shared);
2600
2601/* RaiseErrorWithObjectType.proto (used by ObjectGetItem) */
2602#define __Pyx_RaiseTypeErrorWithObjectType(message, obj) __Pyx_RaiseErrorWithObjectType(PyExc_TypeError, message, obj)
2603#define __Pyx_RaiseErrorWithObjectType(exc_type, message, obj) __Pyx_RaiseErrorWithType(exc_type, message, Py_TYPE(obj))
2604CYTHON_UNUSED
2605static void __Pyx_RaiseErrorWithType(PyObject* exc_type, const char* message, PyTypeObject *type_obj);
2606
2607/* ObjectGetItem.proto */
2608#if CYTHON_USE_TYPE_SLOTS
2609static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key);
2610#else
2611#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
2612#endif
2613
2614/* PySequenceContains.proto */
2615static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
2616 int result = PySequence_Contains(seq, item);
2617 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
2618}
2619
2620/* pybytes_as_double.proto (used by pynumber_float) */
2621static double __Pyx_SlowPyString_AsDouble(PyObject *obj);
2622static double __Pyx__PyBytes_AsDouble(PyObject *obj, const char* start, Py_ssize_t length);
2623static CYTHON_INLINE double __Pyx_PyBytes_AsDouble(PyObject *obj) {
2624 char* as_c_string;
2625 Py_ssize_t size;
2626#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
2627 as_c_string = PyBytes_AS_STRING(obj);
2628 size = PyBytes_GET_SIZE(obj);
2629#else
2630 if (PyBytes_AsStringAndSize(obj, &as_c_string, &size) < 0) {
2631 return (double)-1;
2632 }
2633#endif
2634 return __Pyx__PyBytes_AsDouble(obj, as_c_string, size);
2635}
2636static CYTHON_INLINE double __Pyx_PyByteArray_AsDouble(PyObject *obj) {
2637 char* as_c_string;
2638 Py_ssize_t size;
2639#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
2640 as_c_string = PyByteArray_AS_STRING(obj);
2641 size = PyByteArray_GET_SIZE(obj);
2642#else
2643 as_c_string = PyByteArray_AsString(obj);
2644 if (as_c_string == NULL) {
2645 return (double)-1;
2646 }
2647 size = PyByteArray_Size(obj);
2648#endif
2649 return __Pyx__PyBytes_AsDouble(obj, as_c_string, size);
2650}
2651
2652/* pyunicode_as_double.proto (used by pynumber_float) */
2653#if !CYTHON_COMPILING_IN_PYPY && CYTHON_ASSUME_SAFE_MACROS
2654static const char* __Pyx__PyUnicode_AsDouble_Copy(const void* data, const int kind, char* buffer, Py_ssize_t start, Py_ssize_t end) {
2655 int last_was_punctuation;
2656 Py_ssize_t i;
2657 last_was_punctuation = 1;
2658 for (i=start; i <= end; i++) {
2659 Py_UCS4 chr = PyUnicode_READ(kind, data, i);
2660 int is_punctuation = (chr == '_') | (chr == '.');
2661 *buffer = (char)chr;
2662 buffer += (chr != '_');
2663 if (unlikely(chr > 127)) goto parse_failure;
2664 if (unlikely(last_was_punctuation & is_punctuation)) goto parse_failure;
2665 last_was_punctuation = is_punctuation;
2666 }
2667 if (unlikely(last_was_punctuation)) goto parse_failure;
2668 *buffer = '\0';
2669 return buffer;
2670parse_failure:
2671 return NULL;
2672}
2673static double __Pyx__PyUnicode_AsDouble_inf_nan(const void* data, int kind, Py_ssize_t start, Py_ssize_t length) {
2674 int matches = 1;
2675 Py_UCS4 chr;
2676 Py_UCS4 sign = PyUnicode_READ(kind, data, start);
2677 int is_signed = (sign == '-') | (sign == '+');
2678 start += is_signed;
2679 length -= is_signed;
2680 switch (PyUnicode_READ(kind, data, start)) {
2681 #ifdef Py_NAN
2682 case 'n':
2683 case 'N':
2684 if (unlikely(length != 3)) goto parse_failure;
2685 chr = PyUnicode_READ(kind, data, start+1);
2686 matches &= (chr == 'a') | (chr == 'A');
2687 chr = PyUnicode_READ(kind, data, start+2);
2688 matches &= (chr == 'n') | (chr == 'N');
2689 if (unlikely(!matches)) goto parse_failure;
2690 return (sign == '-') ? -Py_NAN : Py_NAN;
2691 #endif
2692 case 'i':
2693 case 'I':
2694 if (unlikely(length < 3)) goto parse_failure;
2695 chr = PyUnicode_READ(kind, data, start+1);
2696 matches &= (chr == 'n') | (chr == 'N');
2697 chr = PyUnicode_READ(kind, data, start+2);
2698 matches &= (chr == 'f') | (chr == 'F');
2699 if (likely(length == 3 && matches))
2700 return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
2701 if (unlikely(length != 8)) goto parse_failure;
2702 chr = PyUnicode_READ(kind, data, start+3);
2703 matches &= (chr == 'i') | (chr == 'I');
2704 chr = PyUnicode_READ(kind, data, start+4);
2705 matches &= (chr == 'n') | (chr == 'N');
2706 chr = PyUnicode_READ(kind, data, start+5);
2707 matches &= (chr == 'i') | (chr == 'I');
2708 chr = PyUnicode_READ(kind, data, start+6);
2709 matches &= (chr == 't') | (chr == 'T');
2710 chr = PyUnicode_READ(kind, data, start+7);
2711 matches &= (chr == 'y') | (chr == 'Y');
2712 if (unlikely(!matches)) goto parse_failure;
2713 return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
2714 case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
2715 break;
2716 default:
2717 goto parse_failure;
2718 }
2719 return 0.0;
2720parse_failure:
2721 return -1.0;
2722}
2723static double __Pyx_PyUnicode_AsDouble_WithSpaces(PyObject *obj) {
2724 double value;
2725 const char *last;
2726 char *end;
2727 int valid_parse;
2728 Py_ssize_t start, length = PyUnicode_GET_LENGTH(obj);
2729 const int kind = PyUnicode_KIND(obj);
2730 const void* data = PyUnicode_DATA(obj);
2731 start = 0;
2732 while (Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, start)))
2733 start++;
2734 while (start < length - 1 && Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, length - 1)))
2735 length--;
2736 length -= start;
2737 if (unlikely(length <= 0)) goto fallback;
2738 value = __Pyx__PyUnicode_AsDouble_inf_nan(data, kind, start, length);
2739 if (value != 0.0) {
2740 if (unlikely(value == -1.0)) goto fallback;
2741 return value;
2742 }
2743 if (length < 40) {
2744 char number[40];
2745 last = __Pyx__PyUnicode_AsDouble_Copy(data, kind, number, start, start + length);
2746 if (unlikely(!last)) goto fallback;
2747 value = PyOS_string_to_double(number, &end, NULL);
2748 valid_parse = (end == last);
2749 } else {
2750 char *number = (char*) PyMem_Malloc(((size_t) length + 1) * sizeof(char));
2751 if (unlikely(!number)) goto fallback;
2752 last = __Pyx__PyUnicode_AsDouble_Copy(data, kind, number, start, start + length);
2753 if (unlikely(!last)) {
2754 PyMem_Free(number);
2755 goto fallback;
2756 }
2757 value = PyOS_string_to_double(number, &end, NULL);
2758 valid_parse = (end == last);
2759 PyMem_Free(number);
2760 }
2761 if (likely(valid_parse) || (value == (double)-1 && PyErr_Occurred())) {
2762 return value;
2763 }
2764fallback:
2765 return __Pyx_SlowPyString_AsDouble(obj);
2766}
2767#endif
2768static CYTHON_INLINE double __Pyx_PyUnicode_AsDouble(PyObject *obj) {
2769#if !CYTHON_COMPILING_IN_PYPY && CYTHON_ASSUME_SAFE_MACROS
2770 if (unlikely(__Pyx_PyUnicode_READY(obj) == -1))
2771 return (double)-1;
2772 if (likely(PyUnicode_IS_ASCII(obj))) {
2773 const char *s;
2774 Py_ssize_t length;
2775 s = PyUnicode_AsUTF8AndSize(obj, &length);
2776 return __Pyx__PyBytes_AsDouble(obj, s, length);
2777 }
2778 return __Pyx_PyUnicode_AsDouble_WithSpaces(obj);
2779#else
2780 return __Pyx_SlowPyString_AsDouble(obj);
2781#endif
2782}
2783
2784/* pynumber_float.proto */
2785static CYTHON_INLINE PyObject* __Pyx__PyNumber_Float(PyObject* obj);
2786#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : __Pyx__PyNumber_Float(x))
2787
2788/* pybuiltin_invalid.export */
2789static void __Pyx_PyBuiltin_Invalid(PyObject *obj, const char *builtin_type_name, const char *argname);
2790
2791/* pyfloat_simplify.proto */
2792static CYTHON_INLINE int __Pyx_PyFloat_FromNumber(PyObject **number_var, const char *argname, int accept_none);
2793
2794/* UnicodeEqualsUCS4.proto (used by UnicodeEquals_uchar) */
2795#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL
2796#define __Pyx_PyObject_Equals_uchar(s1, s2, ch2, equals, s1_is_str) (\
2797 ((s1) == (s2)) ? ((equals) == Py_EQ) :\
2798 ((s1) == Py_None) ? ((equals) == Py_NE) :\
2799 __Pyx_PyObject_RichCompareBool(s1, s2, equals)\
2800 )
2801#else
2802#define __Pyx_PyObject_Equals_uchar(s1, s2, ch2, equals, s1_is_str) (\
2803 ((s1) == (s2)) ? ((equals) == Py_EQ) :\
2804 ((s1) == Py_None) ? ((equals) == Py_NE) :\
2805 (likely((s1_is_str) || PyUnicode_CheckExact(s1)) ?\
2806 __Pyx__PyUnicode_EqualsUCS4(s1, ch2, equals) :\
2807 __Pyx_PyObject_RichCompareBool(s1, s2, equals)\
2808 ))
2809static CYTHON_INLINE int __Pyx__PyUnicode_EqualsUCS4(PyObject* s1, Py_UCS4 ch2, int equals);
2810#endif
2811
2812/* UnicodeEquals_uchar.proto */
2813#define __Pyx_PyObject_Equals_obj_ch46(s1, s2, equals) __Pyx_PyObject_Equals_uchar(s1, s2, 46, equals, 0)
2814
2815/* TypeImport.proto */
2816#ifndef __PYX_HAVE_RT_ImportType_proto_3_3_0
2817#define __PYX_HAVE_RT_ImportType_proto_3_3_0
2818#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
2819#include <stdalign.h>
2820#endif
2821#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
2822#define __PYX_GET_STRUCT_ALIGNMENT_3_3_0(s) alignof(s)
2823#else
2824#define __PYX_GET_STRUCT_ALIGNMENT_3_3_0(s) sizeof(void*)
2825#endif
2826enum __Pyx_ImportType_CheckSize_3_3_0 {
2827 __Pyx_ImportType_CheckSize_Error_3_3_0 = 0,
2828 __Pyx_ImportType_CheckSize_Warn_3_3_0 = 1,
2829 __Pyx_ImportType_CheckSize_Ignore_3_3_0 = 2
2830};
2831static PyTypeObject *__Pyx_ImportType_3_3_0(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_3_0 check_size);
2832#endif
2833
2834/* HasAttr.proto (used by ImportImpl) */
2835#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
2836#define __Pyx_HasAttr(o, n) PyObject_HasAttrWithError(o, n)
2837#else
2838static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
2839#endif
2840
2841/* TupleOrListFromArrayImpl.proto (used by ListFromArray) */
2842CYTHON_UNUSED static PyObject *
2843__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);
2844
2845/* ListFromArray.proto (used by ImportImpl) */
2846
2847
2848/* ImportImpl.export */
2849static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level);
2850
2851/* Import.proto */
2852static CYTHON_INLINE PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level);
2853
2854/* ImportFrom.export */
2855static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2856
2857/* dict_setdefault.proto (used by FetchCommonType) */
2858static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value);
2859
2860/* AddModuleRef.proto (used by FetchSharedCythonModule) */
2861#if ((CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX < 0x030F00a3) ||\
2862 __PYX_LIMITED_VERSION_HEX < 0x030d0000)
2863 static PyObject *__Pyx_PyImport_AddModuleRef(const char *name);
2864#else
2865 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
2866#endif
2867
2868/* FetchSharedCythonModule.proto (used by FetchCommonType) */
2869static PyObject *__Pyx_FetchSharedCythonABIModule(void);
2870
2871/* VerifyCachedType.proto (used by FetchCommonType) */
2872static int __Pyx_VerifyCachedType(PyObject *cached_type,
2873 const char *name,
2874 Py_ssize_t expected_basicsize);
2875
2876/* FetchCommonType.proto (used by CommonTypesMetaclass) */
2877static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases);
2878
2879/* CommonTypesMetaclass.proto (used by CythonFunctionShared) */
2880static int __pyx_CommonTypesMetaclass_init(PyObject *module);
2881#define __Pyx_CommonTypesMetaclass_USED
2882
2883/* CythonFunctionPerModule.proto (used by CythonFunctionShared) */
2884#define __Pyx_CyFunction_USED
2885#if CYTHON_OPAQUE_SHARED_TYPES
2886#define __Pyx_as_CyFunctionObject(o) ((__pyx_CyFunctionObject *)PyObject_GetTypeData((o), __pyx_mstate_global->__pyx_CyFunctionType))
2887#else
2888#define __Pyx_as_CyFunctionObject(o) ((__pyx_CyFunctionObject *)o)
2889#endif
2890#define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2891#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2892#define __Pyx_CYFUNCTION_CCLASS 0x04
2893#define __Pyx_CYFUNCTION_COROUTINE 0x08
2894#define __Pyx_CyFunction_GetClosure(f)\
2895 ((__Pyx_as_CyFunctionObject(f))->func_closure)
2896#if CYTHON_COMPILING_IN_LIMITED_API
2897 #define __Pyx__CyFunction_GetClassObj(f)\
2898 ((f)->func_classobj)
2899#else
2900 #define __Pyx__CyFunction_GetClassObj(f)\
2901 ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
2902#endif
2903#define __Pyx_CyFunction_GetClassObj(f)\
2904 __Pyx__CyFunction_GetClassObj(__Pyx_as_CyFunctionObject(f))
2905#define __Pyx_CyFunction_SetClassObj(f, classobj)\
2906 __Pyx__CyFunction_SetClassObj(__Pyx_as_CyFunctionObject(f), (classobj))
2907#define __Pyx_CyFunction_Defaults(type, f)\
2908 ((type *)((__Pyx_as_CyFunctionObject(f))->defaults))
2909#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2910 (__Pyx_as_CyFunctionObject(f))->defaults_getter = (g)
2911typedef struct {
2912#if CYTHON_COMPILING_IN_LIMITED_API
2913#if !CYTHON_OPAQUE_OBJECTS
2914 PyObject_HEAD
2915#endif
2916 PyMethodDef *func_methoddef;
2917 PyObject *func_module;
2918#else
2919 PyCMethodObject func;
2920#endif
2921#if (CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY) && CYTHON_VECTORCALL
2922 __pyx_vectorcallfunc func_vectorcall;
2923#endif
2924#if CYTHON_COMPILING_IN_LIMITED_API
2925 PyObject *func_weakreflist;
2926#endif
2927#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
2928 PyObject *func_dict;
2929#endif
2930 PyObject *func_name;
2931 PyObject *func_qualname;
2932 PyObject *func_doc;
2933 PyObject *func_globals;
2934 PyObject *func_code;
2935 PyObject *func_closure;
2936#if CYTHON_COMPILING_IN_LIMITED_API
2937 PyObject *func_classobj;
2938#endif
2939 PyObject *defaults;
2940 int flags;
2941 PyObject *defaults_tuple;
2942 PyObject *defaults_kwdict;
2943 PyObject *(*defaults_getter)(PyObject *);
2944 PyObject *func_annotations;
2945#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
2946 PyObject *func_is_coroutine;
2947#endif
2948} __pyx_CyFunctionObject;
2949#undef __Pyx_CyOrPyCFunction_Check
2950#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_mstate_global->__pyx_CyFunctionType)
2951#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_mstate_global->__pyx_CyFunctionType, &PyCFunction_Type)
2952#define __Pyx_CyFunction_CheckExact(obj) Py_IS_TYPE(obj, __pyx_mstate_global->__pyx_CyFunctionType)
2953static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void));
2954#undef __Pyx_IsSameCFunction
2955#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc)
2956static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj);
2957static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func,
2958 PyTypeObject *defaults_type);
2959static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2960 PyObject *tuple);
2961static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2962 PyObject *dict);
2963static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2964 PyObject *dict);
2965static int __pyx_CyFunction_init(PyObject *module);
2966#if CYTHON_VECTORCALL
2967#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
2968#define __Pyx_CyFunction_func_vectorcall(f) ((f)->func_vectorcall)
2969#else
2970#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
2971#endif
2972#endif
2973
2974/* CallTypeTraverse.proto (used by CythonFunctionShared) */
2975#if !CYTHON_USE_TYPE_SPECS
2976#define __Pyx_call_type_traverse(o, always_call, visit, arg) 0
2977#else
2978static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg);
2979#endif
2980
2981/* PyMethodNew.proto (used by CythonFunctionShared) */
2982static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ);
2983
2984/* PyVectorcallFastCallDict.proto (used by CythonFunctionShared) */
2985#if CYTHON_VECTORCALL
2986static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw);
2987#endif
2988
2989/* CythonFunctionShared.proto (used by CythonFunction) */
2990static PyObject *__Pyx_CyFunction_Init(PyObject *op_in, PyMethodDef *ml,
2991 int flags, PyObject* qualname,
2992 PyObject *closure,
2993 PyObject *module, PyObject *globals,
2994 PyObject* code);
2995#if CYTHON_VECTORCALL
2996static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
2997static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
2998static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
2999static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3000#endif
3001
3002/* CythonFunction.export */
3003static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
3004 int flags, PyObject* qualname,
3005 PyObject *closure,
3006 PyObject *module, PyObject *globals,
3007 PyObject* code);
3008static PyTypeObject *__Pyx_Get_CyFunction_Type(void);
3009
3010/* CLineInTraceback.proto (used by AddTraceback) */
3011#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
3012static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
3013#else
3014#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
3015#endif
3016
3017/* CodeObjectCache.proto (used by AddTraceback) */
3018#if CYTHON_COMPILING_IN_LIMITED_API
3019typedef PyObject __Pyx_CachedCodeObjectType;
3020#else
3021typedef PyCodeObject __Pyx_CachedCodeObjectType;
3022#endif
3023typedef struct {
3024 __Pyx_CachedCodeObjectType* code_object;
3025 int code_line;
3026} __Pyx_CodeObjectCacheEntry;
3027struct __Pyx_CodeObjectCache {
3028 int count;
3029 int max_count;
3030 __Pyx_CodeObjectCacheEntry* entries;
3031 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
3032 __pyx_atomic_int_type accessor_count;
3033 #endif
3034};
3035static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
3036static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line);
3037static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object);
3038
3039/* AddTraceback.proto */
3040static void __Pyx_AddTraceback(const char *funcname, int c_line,
3041 int py_line, const char *filename);
3042
3043/* GCCDiagnostics.proto */
3044#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
3045#define __Pyx_HAS_GCC_DIAGNOSTIC
3046#endif
3047
3048/* RealImag.proto */
3049#if CYTHON_CCOMPLEX
3050 #ifdef __cplusplus
3051 #define __Pyx_CREAL(z) ((z).real())
3052 #define __Pyx_CIMAG(z) ((z).imag())
3053 #else
3054 #define __Pyx_CREAL(z) (__real__(z))
3055 #define __Pyx_CIMAG(z) (__imag__(z))
3056 #endif
3057#else
3058 #define __Pyx_CREAL(z) ((z).real)
3059 #define __Pyx_CIMAG(z) ((z).imag)
3060#endif
3061#if defined(__cplusplus) && CYTHON_CCOMPLEX\
3062 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
3063 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
3064 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
3065#else
3066 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
3067 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
3068#endif
3069
3070/* Arithmetic.proto */
3071#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3072 #define __Pyx_c_eq_float(a, b) ((a)==(b))
3073 #define __Pyx_c_sum_float(a, b) ((a)+(b))
3074 #define __Pyx_c_diff_float(a, b) ((a)-(b))
3075 #define __Pyx_c_prod_float(a, b) ((a)*(b))
3076 #define __Pyx_c_quot_float(a, b) ((a)/(b))
3077 #define __Pyx_c_neg_float(a) (-(a))
3078 #ifdef __cplusplus
3079 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
3080 #define __Pyx_c_conj_float(z) (::std::conj(z))
3081 #if 1
3082 #define __Pyx_c_abs_float(z) (::std::abs(z))
3083 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
3084 #endif
3085 #else
3086 #define __Pyx_c_is_zero_float(z) ((z)==0)
3087 #define __Pyx_c_conj_float(z) (conjf(z))
3088 #if 1
3089 #define __Pyx_c_abs_float(z) (cabsf(z))
3090 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
3091 #endif
3092 #endif
3093#else
3094 static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
3095 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
3096 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
3097 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
3098 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
3099 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
3100 static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
3101 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
3102 #if 1
3103 static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
3104 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
3105 #endif
3106#endif
3107
3108/* Arithmetic.proto */
3109#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3110 #define __Pyx_c_eq_double(a, b) ((a)==(b))
3111 #define __Pyx_c_sum_double(a, b) ((a)+(b))
3112 #define __Pyx_c_diff_double(a, b) ((a)-(b))
3113 #define __Pyx_c_prod_double(a, b) ((a)*(b))
3114 #define __Pyx_c_quot_double(a, b) ((a)/(b))
3115 #define __Pyx_c_neg_double(a) (-(a))
3116 #ifdef __cplusplus
3117 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
3118 #define __Pyx_c_conj_double(z) (::std::conj(z))
3119 #if 1
3120 #define __Pyx_c_abs_double(z) (::std::abs(z))
3121 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
3122 #endif
3123 #else
3124 #define __Pyx_c_is_zero_double(z) ((z)==0)
3125 #define __Pyx_c_conj_double(z) (conj(z))
3126 #if 1
3127 #define __Pyx_c_abs_double(z) (cabs(z))
3128 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
3129 #endif
3130 #endif
3131#else
3132 static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
3133 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
3134 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
3135 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
3136 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
3137 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
3138 static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
3139 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
3140 #if 1
3141 static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
3142 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
3143 #endif
3144#endif
3145
3146/* Arithmetic.proto */
3147#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3148 #define __Pyx_c_eq_long__double(a, b) ((a)==(b))
3149 #define __Pyx_c_sum_long__double(a, b) ((a)+(b))
3150 #define __Pyx_c_diff_long__double(a, b) ((a)-(b))
3151 #define __Pyx_c_prod_long__double(a, b) ((a)*(b))
3152 #define __Pyx_c_quot_long__double(a, b) ((a)/(b))
3153 #define __Pyx_c_neg_long__double(a) (-(a))
3154 #ifdef __cplusplus
3155 #define __Pyx_c_is_zero_long__double(z) ((z)==(long double)0)
3156 #define __Pyx_c_conj_long__double(z) (::std::conj(z))
3157 #if 1
3158 #define __Pyx_c_abs_long__double(z) (::std::abs(z))
3159 #define __Pyx_c_pow_long__double(a, b) (::std::pow(a, b))
3160 #endif
3161 #else
3162 #define __Pyx_c_is_zero_long__double(z) ((z)==0)
3163 #define __Pyx_c_conj_long__double(z) (conjl(z))
3164 #if 1
3165 #define __Pyx_c_abs_long__double(z) (cabsl(z))
3166 #define __Pyx_c_pow_long__double(a, b) (cpowl(a, b))
3167 #endif
3168 #endif
3169#else
3170 static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3171 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3172 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3173 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3174 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3175 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex);
3176 static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex);
3177 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex);
3178 #if 1
3179 static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex);
3180 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3181 #endif
3182#endif
3183
3184/* CIntToPy.proto */
3185static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value);
3186
3187/* CIntFromPy.proto */
3188static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *);
3189
3190/* CIntFromPy.proto */
3191static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *);
3192
3193/* GetRuntimeVersion.proto */
3194#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
3195static unsigned long __Pyx_cached_runtime_version = 0;
3196static void __Pyx_init_runtime_version(void);
3197#else
3198#define __Pyx_init_runtime_version()
3199#endif
3200static unsigned long __Pyx_get_runtime_version(void);
3201
3202/* CheckBinaryVersion.proto */
3203static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);
3204
3205/* DecompressString.proto */
3206static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo);
3207
3208/* DecompressString_LZSS.proto */
3209static PyObject *__Pyx_DecompressString_LZSS(const char *s, size_t compressed_length, size_t uncompressed_length);
3210
3211/* MultiPhaseInitModuleState.proto */
3212#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
3213#include <stdlib.h>
3214static PyObject *__Pyx_State_FindModule(void*);
3215static int __Pyx_State_AddModule(PyObject* module, void*);
3216static int __Pyx_State_RemoveModule(void*);
3217#elif CYTHON_USE_MODULE_STATE
3218#define __Pyx_State_FindModule PyState_FindModule
3219#define __Pyx_State_AddModule PyState_AddModule
3220#define __Pyx_State_RemoveModule PyState_RemoveModule
3221#endif
3222
3223/* #### Code section: module_declarations ### */
3224/* CythonABIVersion.proto */
3225#if CYTHON_COMPILING_IN_LIMITED_API
3226 #if CYTHON_VECTORCALL
3227 #define __PYX_VECTORCALL_ABI_SUFFIX "_vectorcall"
3228 #else
3229 #define __PYX_VECTORCALL_ABI_SUFFIX
3230 #endif
3231 #define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_VECTORCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
3232#else
3233 #define __PYX_LIMITED_ABI_SUFFIX
3234#endif
3235#if __PYX_HAS_PY_AM_SEND == 1
3236 #define __PYX_AM_SEND_ABI_SUFFIX
3237#elif __PYX_HAS_PY_AM_SEND == 2
3238 #define __PYX_AM_SEND_ABI_SUFFIX "amsendbackport"
3239#else
3240 #define __PYX_AM_SEND_ABI_SUFFIX "noamsend"
3241#endif
3242#ifndef __PYX_MONITORING_ABI_SUFFIX
3243 #define __PYX_MONITORING_ABI_SUFFIX
3244#endif
3245#if CYTHON_USE_TP_FINALIZE
3246 #define __PYX_TP_FINALIZE_ABI_SUFFIX
3247#else
3248 #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize"
3249#endif
3250#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED)
3251 #define __PYX_FREELISTS_ABI_SUFFIX
3252#else
3253 #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists"
3254#endif
3255#if CYTHON_OPAQUE_OBJECTS && CYTHON_COMPILING_IN_LIMITED_API
3256 #define __PYX_OPAQUE_OBJECTS_ABI_SUFFIX "opaque"
3257#else
3258 #define __PYX_OPAQUE_OBJECTS_ABI_SUFFIX
3259#endif
3260#define CYTHON_ABI __PYX_ABI_VERSION __PYX_LIMITED_ABI_SUFFIX __PYX_MONITORING_ABI_SUFFIX __PYX_TP_FINALIZE_ABI_SUFFIX __PYX_FREELISTS_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX __PYX_OPAQUE_OBJECTS_ABI_SUFFIX
3261#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
3262#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
3263
3264static CYTHON_INLINE PyTypeObject *__pyx_f_5numpy_5dtype_7typeobj___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3265static CYTHON_INLINE char __pyx_f_5numpy_5dtype_4kind___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3266static CYTHON_INLINE char __pyx_f_5numpy_5dtype_4type___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3267static CYTHON_INLINE char __pyx_f_5numpy_5dtype_9byteorder___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3268static CYTHON_INLINE int __pyx_f_5numpy_5dtype_8type_num___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3269static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3270static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3271static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3272static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3273static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3274static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3275static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3276static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3277static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3278static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3279static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3280static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3281static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base___get__(PyArrayObject *__pyx_v_self); /* proto*/
3282static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr___get__(PyArrayObject *__pyx_v_self); /* proto*/
3283static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim___get__(PyArrayObject *__pyx_v_self); /* proto*/
3284static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape___get__(PyArrayObject *__pyx_v_self); /* proto*/
3285static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides___get__(PyArrayObject *__pyx_v_self); /* proto*/
3286static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size___get__(PyArrayObject *__pyx_v_self); /* proto*/
3287static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data___get__(PyArrayObject *__pyx_v_self); /* proto*/
3288static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_3nin___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3289static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_4nout___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3290static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_5nargs___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3291static CYTHON_INLINE PyUFuncGenericFunction *__pyx_f_5numpy_5ufunc_9functions___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3292static CYTHON_INLINE void **__pyx_f_5numpy_5ufunc_4data___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3293static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_6ntypes___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3294static CYTHON_INLINE char const *__pyx_f_5numpy_5ufunc_4name___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3295static CYTHON_INLINE char const *__pyx_f_5numpy_5ufunc_3doc___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3296static CYTHON_INLINE void *__pyx_f_5numpy_5ufunc_3ptr___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3297static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_3obj___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3298static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_9userloops___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3299
3300/* Module declarations from "libc.string" */
3301
3302/* Module declarations from "libc.stdio" */
3303
3304/* Module declarations from "__builtin__" */
3305
3306/* Module declarations from "cpython.type" */
3307
3308/* Module declarations from "cpython" */
3309
3310/* Module declarations from "cpython.object" */
3311
3312/* Module declarations from "cpython.ref" */
3313
3314/* Module declarations from "numpy" */
3315
3316/* Module declarations from "numpy" */
3317
3318/* Module declarations from "fenton.Fenton" */
3319/* #### Code section: typeinfo ### */
3320/* #### Code section: before_global_var ### */
3321#define __Pyx_MODULE_NAME "fenton.Fenton"
3322extern int __pyx_module_is_main_fenton__Fenton;
3323int __pyx_module_is_main_fenton__Fenton = 0;
3324
3325/* Implementation of "fenton.Fenton" */
3326/* #### Code section: global_var ### */
3327static PyObject *__pyx_builtin_open;
3328/* #### Code section: string_decls ### */
3329static const char __pyx_k_Scripts_for_creating_Fenton_wav[] = "\nScripts for creating Fenton waves.\nModified from johndfenton.com/Steady-waves/Fourier.html to work with python and Proteus\nUsed in proteus.WaveTools\n";
3330/* #### Code section: decls ### */
3331static PyObject *__pyx_pf_6fenton_6Fenton_writeInput(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_waveheight, PyObject *__pyx_v_depth, PyObject *__pyx_v_period, PyObject *__pyx_v_wavelength, PyObject *__pyx_v_mode, PyObject *__pyx_v_current_criterion, PyObject *__pyx_v_current_magnitude, PyObject *__pyx_v_ncoeffs, PyObject *__pyx_v_height_steps, PyObject *__pyx_v_g, PyObject *__pyx_v_niter, PyObject *__pyx_v_conv_crit, CYTHON_UNUSED PyObject *__pyx_v_points_freesurface, CYTHON_UNUSED PyObject *__pyx_v_points_velocity, CYTHON_UNUSED PyObject *__pyx_v_points_vertical); /* proto */
3332static PyObject *__pyx_pf_6fenton_6Fenton_2runFourier(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
3333static PyObject *__pyx_pf_6fenton_6Fenton_4getBYCoeffs(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
3334static PyObject *__pyx_pf_6fenton_6Fenton_6getWavelength(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
3335static PyObject *__pyx_pf_6fenton_6Fenton_8copyFiles(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
3336static PyObject *__pyx_pf_6fenton_6Fenton_10__get_dir(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
3337/* #### Code section: late_includes ### */
3338/* #### Code section: module_state ### */
3339/* SmallCodeConfig */
3340#ifndef CYTHON_SMALL_CODE
3341#if defined(__clang__)
3342 #define CYTHON_SMALL_CODE
3343#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
3344 #define CYTHON_SMALL_CODE __attribute__((cold))
3345#else
3346 #define CYTHON_SMALL_CODE
3347#endif
3348#endif
3349
3350#ifdef __cplusplus
3351namespace {
3352 #endif
3353 typedef struct {
3354 PyObject *__pyx_d;
3355 PyObject *__pyx_b;
3356 PyObject *__pyx_cython_runtime;
3357 PyObject *__pyx_empty_tuple;
3358 PyObject *__pyx_empty_bytes;
3359 PyObject *__pyx_empty_unicode;
3360 PyTypeObject *__pyx_ptype_7cpython_4type_type;
3361 PyTypeObject *__pyx_ptype_5numpy_dtype;
3362 PyTypeObject *__pyx_ptype_5numpy_flatiter;
3363 PyTypeObject *__pyx_ptype_5numpy_broadcast;
3364 PyTypeObject *__pyx_ptype_5numpy_ndarray;
3365 PyTypeObject *__pyx_ptype_5numpy_generic;
3366 PyTypeObject *__pyx_ptype_5numpy_number;
3367 PyTypeObject *__pyx_ptype_5numpy_integer;
3368 PyTypeObject *__pyx_ptype_5numpy_signedinteger;
3369 PyTypeObject *__pyx_ptype_5numpy_unsignedinteger;
3370 PyTypeObject *__pyx_ptype_5numpy_inexact;
3371 PyTypeObject *__pyx_ptype_5numpy_floating;
3372 PyTypeObject *__pyx_ptype_5numpy_complexfloating;
3373 PyTypeObject *__pyx_ptype_5numpy_flexible;
3374 PyTypeObject *__pyx_ptype_5numpy_character;
3375 PyTypeObject *__pyx_ptype_5numpy_ufunc;
3376 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items;
3377 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop;
3378 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values;
3379 PyObject *__pyx_slice[1];
3380 PyObject *__pyx_tuple[8];
3381 PyObject *__pyx_codeobj_tab[6];
3382 PyObject *__pyx_string_tab[98];
3383 PyObject *__pyx_number_tab[10];
3384/* #### Code section: module_state_contents ### */
3385/* PyFrozenDict.module_state_decls */
3386#if CYTHON_COMPILING_IN_LIMITED_API
3387PyObject *__Pyx_PyFrozenDictType;
3388#endif
3389
3390/* CommonTypesMetaclass.module_state_decls */
3391PyTypeObject *__pyx_CommonTypesMetaclassType;
3392
3393/* CachedMethodType.module_state_decls */
3394#if CYTHON_COMPILING_IN_LIMITED_API
3395PyObject *__Pyx_CachedMethodType;
3396#endif
3397
3398/* CythonFunctionPerModule.module_state_decls */
3399PyTypeObject *__pyx_CyFunctionType;
3400
3401/* CodeObjectCache.module_state_decls */
3402struct __Pyx_CodeObjectCache __pyx_code_cache;
3403
3404/* #### Code section: module_state_end ### */
3405} __pyx_mstatetype;
3406#ifdef __cplusplus
3407} /* anonymous namespace */
3408#endif
3409
3410#if CYTHON_USE_MODULE_STATE
3411#ifdef __cplusplus
3412namespace {
3413extern struct PyModuleDef __pyx_moduledef;
3414} /* anonymous namespace */
3415#else
3416static struct PyModuleDef __pyx_moduledef;
3417#endif
3418
3419#define __pyx_mstate_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef)))
3420
3421#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef))
3422#else
3423static __pyx_mstatetype __pyx_mstate_global_static =
3424#ifdef __cplusplus
3425 {};
3426#else
3427 {0};
3428#endif
3429static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_static;
3430#endif
3431/* #### Code section: constant_name_defines ### */
3432#define __pyx_kp_u__2 __pyx_string_tab[0]
3433#define __pyx_kp_u__3 __pyx_string_tab[1]
3434#define __pyx_kp_u_ __pyx_string_tab[2]
3435#define __pyx_kp_u_Control_file_to_control_converge __pyx_string_tab[3]
3436#define __pyx_kp_u_Convergence_dat __pyx_string_tab[4]
3437#define __pyx_kp_u_Data_dat __pyx_string_tab[5]
3438#define __pyx_kp_u_Flowfield_res __pyx_string_tab[6]
3439#define __pyx_kp_u_Period_or_wavelength_must_be_set __pyx_string_tab[7]
3440#define __pyx_kp_u_Points_dat __pyx_string_tab[8]
3441#define __pyx_kp_u_Solution_res __pyx_string_tab[9]
3442#define __pyx_kp_u_Surface_res __pyx_string_tab[10]
3443#define __pyx_kp_u_Wave_waveheight_mode_length_curr __pyx_string_tab[11]
3444#define __pyx_kp_u_numpy__core_multiarray_failed_to __pyx_string_tab[12]
3445#define __pyx_kp_u_numpy__core_umath_failed_to_impo __pyx_string_tab[13]
3446#define __pyx_kp_u_proteus_fenton_Fenton_pyx __pyx_string_tab[14]
3447#define __pyx_n_u_BCoeffs __pyx_string_tab[15]
3448#define __pyx_n_u_FFT __pyx_string_tab[16]
3449#define __pyx_n_u_Period __pyx_string_tab[17]
3450#define __pyx_n_u_Profiling __pyx_string_tab[18]
3451#define __pyx_n_u_Wave __pyx_string_tab[19]
3452#define __pyx_n_u_Wavelength __pyx_string_tab[20]
3453#define __pyx_n_u_YCoeffs __pyx_string_tab[21]
3454#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[22]
3455#define __pyx_n_u_annotate __pyx_string_tab[23]
3456#define __pyx_n_u_class_getitem __pyx_string_tab[24]
3457#define __pyx_n_u_enter __pyx_string_tab[25]
3458#define __pyx_n_u_exit __pyx_string_tab[26]
3459#define __pyx_n_u_file __pyx_string_tab[27]
3460#define __pyx_n_u_func __pyx_string_tab[28]
3461#define __pyx_n_u_get_dir __pyx_string_tab[29]
3462#define __pyx_n_u_main __pyx_string_tab[30]
3463#define __pyx_n_u_module __pyx_string_tab[31]
3464#define __pyx_n_u_name __pyx_string_tab[32]
3465#define __pyx_n_u_qualname __pyx_string_tab[33]
3466#define __pyx_n_u_test __pyx_string_tab[34]
3467#define __pyx_n_u_is_coroutine __pyx_string_tab[35]
3468#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[36]
3469#define __pyx_n_u_check_call __pyx_string_tab[37]
3470#define __pyx_n_u_cline_in_traceback __pyx_string_tab[38]
3471#define __pyx_n_u_comments __pyx_string_tab[39]
3472#define __pyx_n_u_conv_crit __pyx_string_tab[40]
3473#define __pyx_n_u_copy __pyx_string_tab[41]
3474#define __pyx_n_u_copyFiles __pyx_string_tab[42]
3475#define __pyx_n_u_current_criterion __pyx_string_tab[43]
3476#define __pyx_n_u_current_magnitude __pyx_string_tab[44]
3477#define __pyx_n_u_current_magnitude_dimless __pyx_string_tab[45]
3478#define __pyx_n_u_delimiter __pyx_string_tab[46]
3479#define __pyx_n_u_depth __pyx_string_tab[47]
3480#define __pyx_n_u_dirname __pyx_string_tab[48]
3481#define __pyx_n_u_f __pyx_string_tab[49]
3482#define __pyx_n_u_fenton_Fenton __pyx_string_tab[50]
3483#define __pyx_n_u_filename __pyx_string_tab[51]
3484#define __pyx_n_u_format __pyx_string_tab[52]
3485#define __pyx_n_u_g __pyx_string_tab[53]
3486#define __pyx_n_u_genfromtxt __pyx_string_tab[54]
3487#define __pyx_n_u_getBYCoeffs __pyx_string_tab[55]
3488#define __pyx_n_u_getWavelength __pyx_string_tab[56]
3489#define __pyx_n_u_height_steps __pyx_string_tab[57]
3490#define __pyx_n_u_items __pyx_string_tab[58]
3491#define __pyx_n_u_l __pyx_string_tab[59]
3492#define __pyx_n_u_length __pyx_string_tab[60]
3493#define __pyx_n_u_length_dimless __pyx_string_tab[61]
3494#define __pyx_n_u_line __pyx_string_tab[62]
3495#define __pyx_n_u_logDir __pyx_string_tab[63]
3496#define __pyx_n_u_mode __pyx_string_tab[64]
3497#define __pyx_n_u_ncoeffs __pyx_string_tab[65]
3498#define __pyx_n_u_niter __pyx_string_tab[66]
3499#define __pyx_n_u_np __pyx_string_tab[67]
3500#define __pyx_n_u_numpy __pyx_string_tab[68]
3501#define __pyx_n_u_open __pyx_string_tab[69]
3502#define __pyx_n_u_os __pyx_string_tab[70]
3503#define __pyx_n_u_path __pyx_string_tab[71]
3504#define __pyx_n_u_period __pyx_string_tab[72]
3505#define __pyx_n_u_points_freesurface __pyx_string_tab[73]
3506#define __pyx_n_u_points_velocity __pyx_string_tab[74]
3507#define __pyx_n_u_points_vertical __pyx_string_tab[75]
3508#define __pyx_n_u_pop __pyx_string_tab[76]
3509#define __pyx_n_u_proteus __pyx_string_tab[77]
3510#define __pyx_n_u_r __pyx_string_tab[78]
3511#define __pyx_n_u_runFourier __pyx_string_tab[79]
3512#define __pyx_n_u_setdefault __pyx_string_tab[80]
3513#define __pyx_n_u_shutil __pyx_string_tab[81]
3514#define __pyx_n_u_split __pyx_string_tab[82]
3515#define __pyx_n_u_sqrt __pyx_string_tab[83]
3516#define __pyx_n_u_subprocess __pyx_string_tab[84]
3517#define __pyx_n_u_values __pyx_string_tab[85]
3518#define __pyx_n_u_w __pyx_string_tab[86]
3519#define __pyx_n_u_waveheight __pyx_string_tab[87]
3520#define __pyx_n_u_waveheight_dimless __pyx_string_tab[88]
3521#define __pyx_n_u_wavelength __pyx_string_tab[89]
3522#define __pyx_n_u_write __pyx_string_tab[90]
3523#define __pyx_n_u_writeInput __pyx_string_tab[91]
3524#define __pyx_kp_b_iso88591_2U_1 __pyx_string_tab[92]
3525#define __pyx_kp_b_iso88591_H_7_c_G6_wc_d_WA_q_wgU_k_A_q_q __pyx_string_tab[93]
3526#define __pyx_kp_b_iso88591_y_1_A_A_y_A_1_A_IQ_A_9A_A_Ya __pyx_string_tab[94]
3527#define __pyx_kp_b_iso88591_a __pyx_string_tab[95]
3528#define __pyx_kp_b_iso88591_Kq_c_A_c_A_9A __pyx_string_tab[96]
3529#define __pyx_kp_b_iso88591_Q_ha_HA_F_wc_4y_1_Qaq_5 __pyx_string_tab[97]
3530#define __pyx_float_9_81 __pyx_number_tab[0]
3531#define __pyx_float_1_eneg_05 __pyx_number_tab[1]
3532#define __pyx_int_0 __pyx_number_tab[2]
3533#define __pyx_int_1 __pyx_number_tab[3]
3534#define __pyx_int_2 __pyx_number_tab[4]
3535#define __pyx_int_8 __pyx_number_tab[5]
3536#define __pyx_int_16 __pyx_number_tab[6]
3537#define __pyx_int_20 __pyx_number_tab[7]
3538#define __pyx_int_40 __pyx_number_tab[8]
3539#define __pyx_int_50 __pyx_number_tab[9]
3540/* #### Code section: module_state_clear ### */
3541#if CYTHON_USE_MODULE_STATE
3542static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) {
3543 __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m);
3544 if (!clear_module_state) return 0;
3545 Py_CLEAR(clear_module_state->__pyx_d);
3546 Py_CLEAR(clear_module_state->__pyx_b);
3547 Py_CLEAR(clear_module_state->__pyx_cython_runtime);
3548 Py_CLEAR(clear_module_state->__pyx_empty_tuple);
3549 Py_CLEAR(clear_module_state->__pyx_empty_bytes);
3550 Py_CLEAR(clear_module_state->__pyx_empty_unicode);
3551 #if CYTHON_PEP489_MULTI_PHASE_INIT
3552 __Pyx_State_RemoveModule(NULL);
3553 #endif
3554 Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
3555 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_dtype);
3556 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flatiter);
3557 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_broadcast);
3558 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ndarray);
3559 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_generic);
3560 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_number);
3561 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_integer);
3562 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_signedinteger);
3563 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_unsignedinteger);
3564 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_inexact);
3565 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_floating);
3566 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_complexfloating);
3567 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flexible);
3568 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_character);
3569 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ufunc);
3570 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_items.method);
3571 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_pop.method);
3572 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_values.method);
3573 for (int i=0; i<1; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); }
3574 for (int i=0; i<8; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); }
3575 for (int i=0; i<6; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); }
3576 for (int i=0; i<98; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
3577 for (int i=0; i<10; ++i) { Py_CLEAR(clear_module_state->__pyx_number_tab[i]); }
3578/* #### Code section: module_state_clear_contents ### */
3579/* CommonTypesMetaclass.module_state_clear */
3580Py_CLEAR(clear_module_state->__pyx_CommonTypesMetaclassType);
3581
3582/* CythonFunctionPerModule.module_state_clear */
3583Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
3584
3585/* #### Code section: module_state_clear_end ### */
3586return 0;
3587}
3588#endif
3589/* #### Code section: module_state_traverse ### */
3590#if CYTHON_USE_MODULE_STATE
3591static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
3592 __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m);
3593 if (!traverse_module_state) return 0;
3594 Py_VISIT(traverse_module_state->__pyx_d);
3595 Py_VISIT(traverse_module_state->__pyx_b);
3596 Py_VISIT(traverse_module_state->__pyx_cython_runtime);
3597 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple);
3598 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes);
3599 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode);
3600 Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
3601 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_dtype);
3602 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flatiter);
3603 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_broadcast);
3604 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ndarray);
3605 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_generic);
3606 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_number);
3607 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_integer);
3608 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_signedinteger);
3609 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_unsignedinteger);
3610 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_inexact);
3611 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_floating);
3612 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_complexfloating);
3613 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flexible);
3614 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_character);
3615 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ufunc);
3616 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_items.method);
3617 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_pop.method);
3618 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_values.method);
3619 for (int i=0; i<1; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); }
3620 for (int i=0; i<8; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); }
3621 for (int i=0; i<6; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); }
3622 for (int i=0; i<98; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
3623 for (int i=0; i<10; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_number_tab[i]); }
3624/* #### Code section: module_state_traverse_contents ### */
3625/* CommonTypesMetaclass.module_state_traverse */
3626Py_VISIT(traverse_module_state->__pyx_CommonTypesMetaclassType);
3627
3628/* CythonFunctionPerModule.module_state_traverse */
3629Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
3630
3631/* #### Code section: module_state_traverse_end ### */
3632return 0;
3633}
3634#endif
3635/* #### Code section: module_code ### */
3636
3637/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":230
3638 *
3639 * ctypedef class numpy.dtype [object PyArray_Descr, check_size ignore]:
3640 * @property # <<<<<<<<<<<<<<
3641 * cdef inline PyTypeObject* typeobj(self) noexcept nogil:
3642 * return PyDataType_TYPEOBJ(self)
3643*/
3644
3645static CYTHON_INLINE PyTypeObject *__pyx_f_5numpy_5dtype_7typeobj___get__(PyArray_Descr *__pyx_v_self) {
3646 PyTypeObject *__pyx_r;
3647
3648 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":232
3649 * @property
3650 * cdef inline PyTypeObject* typeobj(self) noexcept nogil:
3651 * return PyDataType_TYPEOBJ(self) # <<<<<<<<<<<<<<
3652 *
3653 * @property
3654*/
3655 {
3656
3657 __pyx_r = PyDataType_TYPEOBJ(__pyx_v_self);
3658 }
3659 goto __pyx_L0;
3660
3661 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":230
3662 *
3663 * ctypedef class numpy.dtype [object PyArray_Descr, check_size ignore]:
3664 * @property # <<<<<<<<<<<<<<
3665 * cdef inline PyTypeObject* typeobj(self) noexcept nogil:
3666 * return PyDataType_TYPEOBJ(self)
3667*/
3668
3669 /* function exit code */
3670 __pyx_L0:;
3671 return __pyx_r;
3672}
3673
3674/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":234
3675 * return PyDataType_TYPEOBJ(self)
3676 *
3677 * @property # <<<<<<<<<<<<<<
3678 * cdef inline char kind(self) noexcept nogil:
3679 * return PyDataType_KIND(self)
3680*/
3681
3682static CYTHON_INLINE char __pyx_f_5numpy_5dtype_4kind___get__(PyArray_Descr *__pyx_v_self) {
3683 char __pyx_r;
3684
3685 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":236
3686 * @property
3687 * cdef inline char kind(self) noexcept nogil:
3688 * return PyDataType_KIND(self) # <<<<<<<<<<<<<<
3689 *
3690 * @property
3691*/
3692 {
3693
3694 __pyx_r = PyDataType_KIND(__pyx_v_self);
3695 }
3696 goto __pyx_L0;
3697
3698 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":234
3699 * return PyDataType_TYPEOBJ(self)
3700 *
3701 * @property # <<<<<<<<<<<<<<
3702 * cdef inline char kind(self) noexcept nogil:
3703 * return PyDataType_KIND(self)
3704*/
3705
3706 /* function exit code */
3707 __pyx_L0:;
3708 return __pyx_r;
3709}
3710
3711/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":238
3712 * return PyDataType_KIND(self)
3713 *
3714 * @property # <<<<<<<<<<<<<<
3715 * cdef inline char type(self) noexcept nogil:
3716 * return PyDataType_TYPE(self)
3717*/
3718
3719static CYTHON_INLINE char __pyx_f_5numpy_5dtype_4type___get__(PyArray_Descr *__pyx_v_self) {
3720 char __pyx_r;
3721
3722 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":240
3723 * @property
3724 * cdef inline char type(self) noexcept nogil:
3725 * return PyDataType_TYPE(self) # <<<<<<<<<<<<<<
3726 *
3727 * # Numpy sometimes mutates this without warning (e.g. it'll
3728*/
3729 {
3730
3731 __pyx_r = PyDataType_TYPE(__pyx_v_self);
3732 }
3733 goto __pyx_L0;
3734
3735 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":238
3736 * return PyDataType_KIND(self)
3737 *
3738 * @property # <<<<<<<<<<<<<<
3739 * cdef inline char type(self) noexcept nogil:
3740 * return PyDataType_TYPE(self)
3741*/
3742
3743 /* function exit code */
3744 __pyx_L0:;
3745 return __pyx_r;
3746}
3747
3748/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":247
3749 * # PyArray_IsNativeByteOrder(dtype.byteorder) instead of
3750 * # directly accessing this field.
3751 * @property # <<<<<<<<<<<<<<
3752 * cdef inline char byteorder(self) noexcept nogil:
3753 * return PyDataType_BYTEORDER(self)
3754*/
3755
3756static CYTHON_INLINE char __pyx_f_5numpy_5dtype_9byteorder___get__(PyArray_Descr *__pyx_v_self) {
3757 char __pyx_r;
3758
3759 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":249
3760 * @property
3761 * cdef inline char byteorder(self) noexcept nogil:
3762 * return PyDataType_BYTEORDER(self) # <<<<<<<<<<<<<<
3763 *
3764 * @property
3765*/
3766 {
3767
3768 __pyx_r = PyDataType_BYTEORDER(__pyx_v_self);
3769 }
3770 goto __pyx_L0;
3771
3772 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":247
3773 * # PyArray_IsNativeByteOrder(dtype.byteorder) instead of
3774 * # directly accessing this field.
3775 * @property # <<<<<<<<<<<<<<
3776 * cdef inline char byteorder(self) noexcept nogil:
3777 * return PyDataType_BYTEORDER(self)
3778*/
3779
3780 /* function exit code */
3781 __pyx_L0:;
3782 return __pyx_r;
3783}
3784
3785/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":251
3786 * return PyDataType_BYTEORDER(self)
3787 *
3788 * @property # <<<<<<<<<<<<<<
3789 * cdef inline int type_num(self) noexcept nogil:
3790 * return PyDataType_TYPENUM(self)
3791*/
3792
3793static CYTHON_INLINE int __pyx_f_5numpy_5dtype_8type_num___get__(PyArray_Descr *__pyx_v_self) {
3794 int __pyx_r;
3795
3796 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":253
3797 * @property
3798 * cdef inline int type_num(self) noexcept nogil:
3799 * return PyDataType_TYPENUM(self) # <<<<<<<<<<<<<<
3800 *
3801 * @property
3802*/
3803 {
3804
3805 __pyx_r = PyDataType_TYPENUM(__pyx_v_self);
3806 }
3807 goto __pyx_L0;
3808
3809 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":251
3810 * return PyDataType_BYTEORDER(self)
3811 *
3812 * @property # <<<<<<<<<<<<<<
3813 * cdef inline int type_num(self) noexcept nogil:
3814 * return PyDataType_TYPENUM(self)
3815*/
3816
3817 /* function exit code */
3818 __pyx_L0:;
3819 return __pyx_r;
3820}
3821
3822/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":255
3823 * return PyDataType_TYPENUM(self)
3824 *
3825 * @property # <<<<<<<<<<<<<<
3826 * cdef inline npy_intp itemsize(self) noexcept nogil:
3827 * return PyDataType_ELSIZE(self)
3828*/
3829
3830static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize___get__(PyArray_Descr *__pyx_v_self) {
3831 npy_intp __pyx_r;
3832
3833 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":257
3834 * @property
3835 * cdef inline npy_intp itemsize(self) noexcept nogil:
3836 * return PyDataType_ELSIZE(self) # <<<<<<<<<<<<<<
3837 *
3838 * @property
3839*/
3840 {
3841
3842 __pyx_r = PyDataType_ELSIZE(__pyx_v_self);
3843 }
3844 goto __pyx_L0;
3845
3846 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":255
3847 * return PyDataType_TYPENUM(self)
3848 *
3849 * @property # <<<<<<<<<<<<<<
3850 * cdef inline npy_intp itemsize(self) noexcept nogil:
3851 * return PyDataType_ELSIZE(self)
3852*/
3853
3854 /* function exit code */
3855 __pyx_L0:;
3856 return __pyx_r;
3857}
3858
3859/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":259
3860 * return PyDataType_ELSIZE(self)
3861 *
3862 * @property # <<<<<<<<<<<<<<
3863 * cdef inline npy_intp alignment(self) noexcept nogil:
3864 * return PyDataType_ALIGNMENT(self)
3865*/
3866
3867static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment___get__(PyArray_Descr *__pyx_v_self) {
3868 npy_intp __pyx_r;
3869
3870 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":261
3871 * @property
3872 * cdef inline npy_intp alignment(self) noexcept nogil:
3873 * return PyDataType_ALIGNMENT(self) # <<<<<<<<<<<<<<
3874 *
3875 * # Use fields/names with care as they may be NULL. You must check
3876*/
3877 {
3878
3879 __pyx_r = PyDataType_ALIGNMENT(__pyx_v_self);
3880 }
3881 goto __pyx_L0;
3882
3883 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":259
3884 * return PyDataType_ELSIZE(self)
3885 *
3886 * @property # <<<<<<<<<<<<<<
3887 * cdef inline npy_intp alignment(self) noexcept nogil:
3888 * return PyDataType_ALIGNMENT(self)
3889*/
3890
3891 /* function exit code */
3892 __pyx_L0:;
3893 return __pyx_r;
3894}
3895
3896/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":265
3897 * # Use fields/names with care as they may be NULL. You must check
3898 * # for this using PyDataType_HASFIELDS.
3899 * @property # <<<<<<<<<<<<<<
3900 * cdef inline object fields(self):
3901 * return <object>PyDataType_FIELDS(self)
3902*/
3903
3904static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields___get__(PyArray_Descr *__pyx_v_self) {
3905 PyObject *__pyx_r = NULL;
3906 __Pyx_RefNannyDeclarations
3907 PyObject *__pyx_t_1;
3908 __Pyx_RefNannySetupContext("__get__", 0);
3909
3910 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":267
3911 * @property
3912 * cdef inline object fields(self):
3913 * return <object>PyDataType_FIELDS(self) # <<<<<<<<<<<<<<
3914 *
3915 * @property
3916*/
3917 __pyx_t_1 = PyDataType_FIELDS(__pyx_v_self);
3918
3919 {
3920 PyObject *__pyx_temp;
3921 {
3922 __pyx_temp = __pyx_r;
3923 __Pyx_INCREF(((PyObject *)__pyx_t_1));
3924 __pyx_r = ((PyObject *)__pyx_t_1);
3925 }
3926 __Pyx_XDECREF(__pyx_temp);
3927 }
3928
3929 goto __pyx_L0;
3930
3931 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":265
3932 * # Use fields/names with care as they may be NULL. You must check
3933 * # for this using PyDataType_HASFIELDS.
3934 * @property # <<<<<<<<<<<<<<
3935 * cdef inline object fields(self):
3936 * return <object>PyDataType_FIELDS(self)
3937*/
3938
3939 /* function exit code */
3940 __pyx_L0:;
3941 __Pyx_XGIVEREF(__pyx_r);
3942 __Pyx_RefNannyFinishContext();
3943 return __pyx_r;
3944}
3945
3946/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":269
3947 * return <object>PyDataType_FIELDS(self)
3948 *
3949 * @property # <<<<<<<<<<<<<<
3950 * cdef inline tuple names(self):
3951 * return <tuple>PyDataType_NAMES(self)
3952*/
3953
3954static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names___get__(PyArray_Descr *__pyx_v_self) {
3955 PyObject *__pyx_r = NULL;
3956 __Pyx_RefNannyDeclarations
3957 PyObject *__pyx_t_1;
3958 __Pyx_RefNannySetupContext("__get__", 0);
3959
3960 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":271
3961 * @property
3962 * cdef inline tuple names(self):
3963 * return <tuple>PyDataType_NAMES(self) # <<<<<<<<<<<<<<
3964 *
3965 * # Use PyDataType_HASSUBARRAY to test whether this field is
3966*/
3967 __pyx_t_1 = PyDataType_NAMES(__pyx_v_self);
3968
3969 {
3970 PyObject *__pyx_temp;
3971 {
3972 __pyx_temp = __pyx_r;
3973 __Pyx_INCREF(((PyObject*)__pyx_t_1));
3974 __pyx_r = ((PyObject*)__pyx_t_1);
3975 }
3976 __Pyx_XDECREF(__pyx_temp);
3977 }
3978
3979 goto __pyx_L0;
3980
3981 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":269
3982 * return <object>PyDataType_FIELDS(self)
3983 *
3984 * @property # <<<<<<<<<<<<<<
3985 * cdef inline tuple names(self):
3986 * return <tuple>PyDataType_NAMES(self)
3987*/
3988
3989 /* function exit code */
3990 __pyx_L0:;
3991 __Pyx_XGIVEREF(__pyx_r);
3992 __Pyx_RefNannyFinishContext();
3993 return __pyx_r;
3994}
3995
3996/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":276
3997 * # valid (the pointer can be NULL). Most users should access
3998 * # this field via the inline helper method PyDataType_SHAPE.
3999 * @property # <<<<<<<<<<<<<<
4000 * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
4001 * return PyDataType_SUBARRAY(self)
4002*/
4003
4004static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray___get__(PyArray_Descr *__pyx_v_self) {
4005 PyArray_ArrayDescr *__pyx_r;
4006
4007 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":278
4008 * @property
4009 * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
4010 * return PyDataType_SUBARRAY(self) # <<<<<<<<<<<<<<
4011 *
4012 * @property
4013*/
4014 {
4015
4016 __pyx_r = PyDataType_SUBARRAY(__pyx_v_self);
4017 }
4018 goto __pyx_L0;
4019
4020 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":276
4021 * # valid (the pointer can be NULL). Most users should access
4022 * # this field via the inline helper method PyDataType_SHAPE.
4023 * @property # <<<<<<<<<<<<<<
4024 * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
4025 * return PyDataType_SUBARRAY(self)
4026*/
4027
4028 /* function exit code */
4029 __pyx_L0:;
4030 return __pyx_r;
4031}
4032
4033/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":280
4034 * return PyDataType_SUBARRAY(self)
4035 *
4036 * @property # <<<<<<<<<<<<<<
4037 * cdef inline npy_uint64 flags(self) noexcept nogil:
4038 * """The data types flags."""
4039*/
4040
4041static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags___get__(PyArray_Descr *__pyx_v_self) {
4042 npy_uint64 __pyx_r;
4043
4044 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":283
4045 * cdef inline npy_uint64 flags(self) noexcept nogil:
4046 * """The data types flags."""
4047 * return PyDataType_FLAGS(self) # <<<<<<<<<<<<<<
4048 *
4049 *
4050*/
4051 {
4052
4053 __pyx_r = PyDataType_FLAGS(__pyx_v_self);
4054 }
4055 goto __pyx_L0;
4056
4057 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":280
4058 * return PyDataType_SUBARRAY(self)
4059 *
4060 * @property # <<<<<<<<<<<<<<
4061 * cdef inline npy_uint64 flags(self) noexcept nogil:
4062 * """The data types flags."""
4063*/
4064
4065 /* function exit code */
4066 __pyx_L0:;
4067 return __pyx_r;
4068}
4069
4070/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":292
4071 * ctypedef class numpy.broadcast [object PyArrayMultiIterObject, check_size ignore]:
4072 *
4073 * @property # <<<<<<<<<<<<<<
4074 * cdef inline int numiter(self) noexcept nogil:
4075 * """The number of arrays that need to be broadcast to the same shape."""
4076*/
4077
4078static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter___get__(PyArrayMultiIterObject *__pyx_v_self) {
4079 int __pyx_r;
4080
4081 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":295
4082 * cdef inline int numiter(self) noexcept nogil:
4083 * """The number of arrays that need to be broadcast to the same shape."""
4084 * return PyArray_MultiIter_NUMITER(self) # <<<<<<<<<<<<<<
4085 *
4086 * @property
4087*/
4088 {
4089
4090 __pyx_r = PyArray_MultiIter_NUMITER(__pyx_v_self);
4091 }
4092 goto __pyx_L0;
4093
4094 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":292
4095 * ctypedef class numpy.broadcast [object PyArrayMultiIterObject, check_size ignore]:
4096 *
4097 * @property # <<<<<<<<<<<<<<
4098 * cdef inline int numiter(self) noexcept nogil:
4099 * """The number of arrays that need to be broadcast to the same shape."""
4100*/
4101
4102 /* function exit code */
4103 __pyx_L0:;
4104 return __pyx_r;
4105}
4106
4107/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":297
4108 * return PyArray_MultiIter_NUMITER(self)
4109 *
4110 * @property # <<<<<<<<<<<<<<
4111 * cdef inline npy_intp size(self) noexcept nogil:
4112 * """The total broadcasted size."""
4113*/
4114
4115static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size___get__(PyArrayMultiIterObject *__pyx_v_self) {
4116 npy_intp __pyx_r;
4117
4118 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":300
4119 * cdef inline npy_intp size(self) noexcept nogil:
4120 * """The total broadcasted size."""
4121 * return PyArray_MultiIter_SIZE(self) # <<<<<<<<<<<<<<
4122 *
4123 * @property
4124*/
4125 {
4126
4127 __pyx_r = PyArray_MultiIter_SIZE(__pyx_v_self);
4128 }
4129 goto __pyx_L0;
4130
4131 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":297
4132 * return PyArray_MultiIter_NUMITER(self)
4133 *
4134 * @property # <<<<<<<<<<<<<<
4135 * cdef inline npy_intp size(self) noexcept nogil:
4136 * """The total broadcasted size."""
4137*/
4138
4139 /* function exit code */
4140 __pyx_L0:;
4141 return __pyx_r;
4142}
4143
4144/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":302
4145 * return PyArray_MultiIter_SIZE(self)
4146 *
4147 * @property # <<<<<<<<<<<<<<
4148 * cdef inline npy_intp index(self) noexcept nogil:
4149 * """The current (1-d) index into the broadcasted result."""
4150*/
4151
4152static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index___get__(PyArrayMultiIterObject *__pyx_v_self) {
4153 npy_intp __pyx_r;
4154
4155 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":305
4156 * cdef inline npy_intp index(self) noexcept nogil:
4157 * """The current (1-d) index into the broadcasted result."""
4158 * return PyArray_MultiIter_INDEX(self) # <<<<<<<<<<<<<<
4159 *
4160 * @property
4161*/
4162 {
4163
4164 __pyx_r = PyArray_MultiIter_INDEX(__pyx_v_self);
4165 }
4166 goto __pyx_L0;
4167
4168 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":302
4169 * return PyArray_MultiIter_SIZE(self)
4170 *
4171 * @property # <<<<<<<<<<<<<<
4172 * cdef inline npy_intp index(self) noexcept nogil:
4173 * """The current (1-d) index into the broadcasted result."""
4174*/
4175
4176 /* function exit code */
4177 __pyx_L0:;
4178 return __pyx_r;
4179}
4180
4181/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":307
4182 * return PyArray_MultiIter_INDEX(self)
4183 *
4184 * @property # <<<<<<<<<<<<<<
4185 * cdef inline int nd(self) noexcept nogil:
4186 * """The number of dimensions in the broadcasted result."""
4187*/
4188
4189static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd___get__(PyArrayMultiIterObject *__pyx_v_self) {
4190 int __pyx_r;
4191
4192 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":310
4193 * cdef inline int nd(self) noexcept nogil:
4194 * """The number of dimensions in the broadcasted result."""
4195 * return PyArray_MultiIter_NDIM(self) # <<<<<<<<<<<<<<
4196 *
4197 * @property
4198*/
4199 {
4200
4201 __pyx_r = PyArray_MultiIter_NDIM(__pyx_v_self);
4202 }
4203 goto __pyx_L0;
4204
4205 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":307
4206 * return PyArray_MultiIter_INDEX(self)
4207 *
4208 * @property # <<<<<<<<<<<<<<
4209 * cdef inline int nd(self) noexcept nogil:
4210 * """The number of dimensions in the broadcasted result."""
4211*/
4212
4213 /* function exit code */
4214 __pyx_L0:;
4215 return __pyx_r;
4216}
4217
4218/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":312
4219 * return PyArray_MultiIter_NDIM(self)
4220 *
4221 * @property # <<<<<<<<<<<<<<
4222 * cdef inline npy_intp* dimensions(self) noexcept nogil:
4223 * """The shape of the broadcasted result."""
4224*/
4225
4226static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions___get__(PyArrayMultiIterObject *__pyx_v_self) {
4227 npy_intp *__pyx_r;
4228
4229 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":315
4230 * cdef inline npy_intp* dimensions(self) noexcept nogil:
4231 * """The shape of the broadcasted result."""
4232 * return PyArray_MultiIter_DIMS(self) # <<<<<<<<<<<<<<
4233 *
4234 * @property
4235*/
4236 {
4237
4238 __pyx_r = PyArray_MultiIter_DIMS(__pyx_v_self);
4239 }
4240 goto __pyx_L0;
4241
4242 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":312
4243 * return PyArray_MultiIter_NDIM(self)
4244 *
4245 * @property # <<<<<<<<<<<<<<
4246 * cdef inline npy_intp* dimensions(self) noexcept nogil:
4247 * """The shape of the broadcasted result."""
4248*/
4249
4250 /* function exit code */
4251 __pyx_L0:;
4252 return __pyx_r;
4253}
4254
4255/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":317
4256 * return PyArray_MultiIter_DIMS(self)
4257 *
4258 * @property # <<<<<<<<<<<<<<
4259 * cdef inline void** iters(self) noexcept nogil:
4260 * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
4261*/
4262
4263static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters___get__(PyArrayMultiIterObject *__pyx_v_self) {
4264 void **__pyx_r;
4265
4266 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":321
4267 * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
4268 * On return, the iterators are adjusted for broadcasting."""
4269 * return PyArray_MultiIter_ITERS(self) # <<<<<<<<<<<<<<
4270 *
4271 *
4272*/
4273 {
4274
4275 __pyx_r = PyArray_MultiIter_ITERS(__pyx_v_self);
4276 }
4277 goto __pyx_L0;
4278
4279 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":317
4280 * return PyArray_MultiIter_DIMS(self)
4281 *
4282 * @property # <<<<<<<<<<<<<<
4283 * cdef inline void** iters(self) noexcept nogil:
4284 * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
4285*/
4286
4287 /* function exit code */
4288 __pyx_L0:;
4289 return __pyx_r;
4290}
4291
4292/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":335
4293 * # Instead, we use properties that map to the corresponding C-API functions.
4294 *
4295 * @property # <<<<<<<<<<<<<<
4296 * cdef inline PyObject* base(self) noexcept nogil:
4297 * """Returns a borrowed reference to the object owning the data/memory.
4298*/
4299
4300static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base___get__(PyArrayObject *__pyx_v_self) {
4301 PyObject *__pyx_r;
4302
4303 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":339
4304 * """Returns a borrowed reference to the object owning the data/memory.
4305 * """
4306 * return PyArray_BASE(self) # <<<<<<<<<<<<<<
4307 *
4308 * @property
4309*/
4310 {
4311
4312 __pyx_r = PyArray_BASE(__pyx_v_self);
4313 }
4314 goto __pyx_L0;
4315
4316 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":335
4317 * # Instead, we use properties that map to the corresponding C-API functions.
4318 *
4319 * @property # <<<<<<<<<<<<<<
4320 * cdef inline PyObject* base(self) noexcept nogil:
4321 * """Returns a borrowed reference to the object owning the data/memory.
4322*/
4323
4324 /* function exit code */
4325 __pyx_L0:;
4326 return __pyx_r;
4327}
4328
4329/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":341
4330 * return PyArray_BASE(self)
4331 *
4332 * @property # <<<<<<<<<<<<<<
4333 * cdef inline dtype descr(self):
4334 * """Returns an owned reference to the dtype of the array.
4335*/
4336
4337static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr___get__(PyArrayObject *__pyx_v_self) {
4338 PyArray_Descr *__pyx_r = NULL;
4339 __Pyx_RefNannyDeclarations
4340 PyArray_Descr *__pyx_t_1;
4341 __Pyx_RefNannySetupContext("__get__", 0);
4342
4343 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":345
4344 * """Returns an owned reference to the dtype of the array.
4345 * """
4346 * return <dtype>PyArray_DESCR(self) # <<<<<<<<<<<<<<
4347 *
4348 * @property
4349*/
4350 __pyx_t_1 = PyArray_DESCR(__pyx_v_self);
4351
4352 {
4353 PyArray_Descr *__pyx_temp;
4354 {
4355 __pyx_temp = __pyx_r;
4356 __Pyx_INCREF((PyObject *)((PyArray_Descr *)__pyx_t_1));
4357 __pyx_r = ((PyArray_Descr *)__pyx_t_1);
4358 }
4359 __Pyx_XDECREF((PyObject *)__pyx_temp);
4360 }
4361
4362 goto __pyx_L0;
4363
4364 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":341
4365 * return PyArray_BASE(self)
4366 *
4367 * @property # <<<<<<<<<<<<<<
4368 * cdef inline dtype descr(self):
4369 * """Returns an owned reference to the dtype of the array.
4370*/
4371
4372 /* function exit code */
4373 __pyx_L0:;
4374 __Pyx_XGIVEREF((PyObject *)__pyx_r);
4375 __Pyx_RefNannyFinishContext();
4376 return __pyx_r;
4377}
4378
4379/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":347
4380 * return <dtype>PyArray_DESCR(self)
4381 *
4382 * @property # <<<<<<<<<<<<<<
4383 * cdef inline int ndim(self) noexcept nogil:
4384 * """Returns the number of dimensions in the array.
4385*/
4386
4387static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim___get__(PyArrayObject *__pyx_v_self) {
4388 int __pyx_r;
4389
4390 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":351
4391 * """Returns the number of dimensions in the array.
4392 * """
4393 * return PyArray_NDIM(self) # <<<<<<<<<<<<<<
4394 *
4395 * @property
4396*/
4397 {
4398
4399 __pyx_r = PyArray_NDIM(__pyx_v_self);
4400 }
4401 goto __pyx_L0;
4402
4403 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":347
4404 * return <dtype>PyArray_DESCR(self)
4405 *
4406 * @property # <<<<<<<<<<<<<<
4407 * cdef inline int ndim(self) noexcept nogil:
4408 * """Returns the number of dimensions in the array.
4409*/
4410
4411 /* function exit code */
4412 __pyx_L0:;
4413 return __pyx_r;
4414}
4415
4416/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":353
4417 * return PyArray_NDIM(self)
4418 *
4419 * @property # <<<<<<<<<<<<<<
4420 * cdef inline npy_intp *shape(self) noexcept nogil:
4421 * """Returns a pointer to the dimensions/shape of the array.
4422*/
4423
4424static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape___get__(PyArrayObject *__pyx_v_self) {
4425 npy_intp *__pyx_r;
4426
4427 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":359
4428 * Can return NULL for 0-dimensional arrays.
4429 * """
4430 * return PyArray_DIMS(self) # <<<<<<<<<<<<<<
4431 *
4432 * @property
4433*/
4434 {
4435
4436 __pyx_r = PyArray_DIMS(__pyx_v_self);
4437 }
4438 goto __pyx_L0;
4439
4440 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":353
4441 * return PyArray_NDIM(self)
4442 *
4443 * @property # <<<<<<<<<<<<<<
4444 * cdef inline npy_intp *shape(self) noexcept nogil:
4445 * """Returns a pointer to the dimensions/shape of the array.
4446*/
4447
4448 /* function exit code */
4449 __pyx_L0:;
4450 return __pyx_r;
4451}
4452
4453/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":361
4454 * return PyArray_DIMS(self)
4455 *
4456 * @property # <<<<<<<<<<<<<<
4457 * cdef inline npy_intp *strides(self) noexcept nogil:
4458 * """Returns a pointer to the strides of the array.
4459*/
4460
4461static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides___get__(PyArrayObject *__pyx_v_self) {
4462 npy_intp *__pyx_r;
4463
4464 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":366
4465 * The number of elements matches the number of dimensions of the array (ndim).
4466 * """
4467 * return PyArray_STRIDES(self) # <<<<<<<<<<<<<<
4468 *
4469 * @property
4470*/
4471 {
4472
4473 __pyx_r = PyArray_STRIDES(__pyx_v_self);
4474 }
4475 goto __pyx_L0;
4476
4477 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":361
4478 * return PyArray_DIMS(self)
4479 *
4480 * @property # <<<<<<<<<<<<<<
4481 * cdef inline npy_intp *strides(self) noexcept nogil:
4482 * """Returns a pointer to the strides of the array.
4483*/
4484
4485 /* function exit code */
4486 __pyx_L0:;
4487 return __pyx_r;
4488}
4489
4490/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":368
4491 * return PyArray_STRIDES(self)
4492 *
4493 * @property # <<<<<<<<<<<<<<
4494 * cdef inline npy_intp size(self) noexcept nogil:
4495 * """Returns the total size (in number of elements) of the array.
4496*/
4497
4498static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size___get__(PyArrayObject *__pyx_v_self) {
4499 npy_intp __pyx_r;
4500
4501 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":372
4502 * """Returns the total size (in number of elements) of the array.
4503 * """
4504 * return PyArray_SIZE(self) # <<<<<<<<<<<<<<
4505 *
4506 * @property
4507*/
4508 {
4509
4510 __pyx_r = PyArray_SIZE(__pyx_v_self);
4511 }
4512 goto __pyx_L0;
4513
4514 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":368
4515 * return PyArray_STRIDES(self)
4516 *
4517 * @property # <<<<<<<<<<<<<<
4518 * cdef inline npy_intp size(self) noexcept nogil:
4519 * """Returns the total size (in number of elements) of the array.
4520*/
4521
4522 /* function exit code */
4523 __pyx_L0:;
4524 return __pyx_r;
4525}
4526
4527/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":374
4528 * return PyArray_SIZE(self)
4529 *
4530 * @property # <<<<<<<<<<<<<<
4531 * cdef inline char* data(self) noexcept nogil:
4532 * """The pointer to the data buffer as a char*.
4533*/
4534
4535static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data___get__(PyArrayObject *__pyx_v_self) {
4536 char *__pyx_r;
4537
4538 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":381
4539 * of `PyArray_DATA()` instead, which returns a 'void*'.
4540 * """
4541 * return PyArray_BYTES(self) # <<<<<<<<<<<<<<
4542 *
4543 *
4544*/
4545 {
4546
4547 __pyx_r = PyArray_BYTES(__pyx_v_self);
4548 }
4549 goto __pyx_L0;
4550
4551 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":374
4552 * return PyArray_SIZE(self)
4553 *
4554 * @property # <<<<<<<<<<<<<<
4555 * cdef inline char* data(self) noexcept nogil:
4556 * """The pointer to the data buffer as a char*.
4557*/
4558
4559 /* function exit code */
4560 __pyx_L0:;
4561 return __pyx_r;
4562}
4563
4564/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":794
4565 * ctypedef long double complex clongdouble_t
4566 *
4567 * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
4568 * return PyArray_MultiIterNew(1, <void*>a)
4569 *
4570*/
4571
4572static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
4573 PyObject *__pyx_r = NULL;
4574 __Pyx_RefNannyDeclarations
4575 PyObject *__pyx_t_1 = NULL;
4576 int __pyx_lineno = 0;
4577 const char *__pyx_filename = NULL;
4578 int __pyx_clineno = 0;
4579 __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
4580
4581 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":795
4582 *
4583 * cdef inline object PyArray_MultiIterNew1(a):
4584 * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
4585 *
4586 * cdef inline object PyArray_MultiIterNew2(a, b):
4587*/
4588 __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 795, __pyx_L1_error)
4589 __Pyx_GOTREF(__pyx_t_1);
4590 {
4591 PyObject *__pyx_temp;
4592 {
4593 __pyx_temp = __pyx_r;
4594 __pyx_r = __pyx_t_1;
4595 }
4596 __Pyx_XDECREF(__pyx_temp);
4597 }
4598 __pyx_t_1 = 0;
4599 goto __pyx_L0;
4600
4601 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":794
4602 * ctypedef long double complex clongdouble_t
4603 *
4604 * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
4605 * return PyArray_MultiIterNew(1, <void*>a)
4606 *
4607*/
4608
4609 /* function exit code */
4610 __pyx_L1_error:;
4611 __Pyx_XDECREF(__pyx_t_1);
4612 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
4613 __pyx_r = 0;
4614 __pyx_L0:;
4615 __Pyx_XGIVEREF(__pyx_r);
4616 __Pyx_RefNannyFinishContext();
4617 return __pyx_r;
4618}
4619
4620/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":797
4621 * return PyArray_MultiIterNew(1, <void*>a)
4622 *
4623 * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
4624 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
4625 *
4626*/
4627
4628static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
4629 PyObject *__pyx_r = NULL;
4630 __Pyx_RefNannyDeclarations
4631 PyObject *__pyx_t_1 = NULL;
4632 int __pyx_lineno = 0;
4633 const char *__pyx_filename = NULL;
4634 int __pyx_clineno = 0;
4635 __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
4636
4637 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":798
4638 *
4639 * cdef inline object PyArray_MultiIterNew2(a, b):
4640 * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
4641 *
4642 * cdef inline object PyArray_MultiIterNew3(a, b, c):
4643*/
4644 __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 798, __pyx_L1_error)
4645 __Pyx_GOTREF(__pyx_t_1);
4646 {
4647 PyObject *__pyx_temp;
4648 {
4649 __pyx_temp = __pyx_r;
4650 __pyx_r = __pyx_t_1;
4651 }
4652 __Pyx_XDECREF(__pyx_temp);
4653 }
4654 __pyx_t_1 = 0;
4655 goto __pyx_L0;
4656
4657 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":797
4658 * return PyArray_MultiIterNew(1, <void*>a)
4659 *
4660 * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
4661 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
4662 *
4663*/
4664
4665 /* function exit code */
4666 __pyx_L1_error:;
4667 __Pyx_XDECREF(__pyx_t_1);
4668 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
4669 __pyx_r = 0;
4670 __pyx_L0:;
4671 __Pyx_XGIVEREF(__pyx_r);
4672 __Pyx_RefNannyFinishContext();
4673 return __pyx_r;
4674}
4675
4676/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":800
4677 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
4678 *
4679 * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
4680 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
4681 *
4682*/
4683
4684static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
4685 PyObject *__pyx_r = NULL;
4686 __Pyx_RefNannyDeclarations
4687 PyObject *__pyx_t_1 = NULL;
4688 int __pyx_lineno = 0;
4689 const char *__pyx_filename = NULL;
4690 int __pyx_clineno = 0;
4691 __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
4692
4693 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":801
4694 *
4695 * cdef inline object PyArray_MultiIterNew3(a, b, c):
4696 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
4697 *
4698 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
4699*/
4700 __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 801, __pyx_L1_error)
4701 __Pyx_GOTREF(__pyx_t_1);
4702 {
4703 PyObject *__pyx_temp;
4704 {
4705 __pyx_temp = __pyx_r;
4706 __pyx_r = __pyx_t_1;
4707 }
4708 __Pyx_XDECREF(__pyx_temp);
4709 }
4710 __pyx_t_1 = 0;
4711 goto __pyx_L0;
4712
4713 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":800
4714 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
4715 *
4716 * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
4717 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
4718 *
4719*/
4720
4721 /* function exit code */
4722 __pyx_L1_error:;
4723 __Pyx_XDECREF(__pyx_t_1);
4724 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
4725 __pyx_r = 0;
4726 __pyx_L0:;
4727 __Pyx_XGIVEREF(__pyx_r);
4728 __Pyx_RefNannyFinishContext();
4729 return __pyx_r;
4730}
4731
4732/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":803
4733 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
4734 *
4735 * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
4736 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
4737 *
4738*/
4739
4740static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
4741 PyObject *__pyx_r = NULL;
4742 __Pyx_RefNannyDeclarations
4743 PyObject *__pyx_t_1 = NULL;
4744 int __pyx_lineno = 0;
4745 const char *__pyx_filename = NULL;
4746 int __pyx_clineno = 0;
4747 __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
4748
4749 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":804
4750 *
4751 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
4752 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
4753 *
4754 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
4755*/
4756 __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 804, __pyx_L1_error)
4757 __Pyx_GOTREF(__pyx_t_1);
4758 {
4759 PyObject *__pyx_temp;
4760 {
4761 __pyx_temp = __pyx_r;
4762 __pyx_r = __pyx_t_1;
4763 }
4764 __Pyx_XDECREF(__pyx_temp);
4765 }
4766 __pyx_t_1 = 0;
4767 goto __pyx_L0;
4768
4769 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":803
4770 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
4771 *
4772 * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
4773 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
4774 *
4775*/
4776
4777 /* function exit code */
4778 __pyx_L1_error:;
4779 __Pyx_XDECREF(__pyx_t_1);
4780 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
4781 __pyx_r = 0;
4782 __pyx_L0:;
4783 __Pyx_XGIVEREF(__pyx_r);
4784 __Pyx_RefNannyFinishContext();
4785 return __pyx_r;
4786}
4787
4788/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":806
4789 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
4790 *
4791 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
4792 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
4793 *
4794*/
4795
4796static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
4797 PyObject *__pyx_r = NULL;
4798 __Pyx_RefNannyDeclarations
4799 PyObject *__pyx_t_1 = NULL;
4800 int __pyx_lineno = 0;
4801 const char *__pyx_filename = NULL;
4802 int __pyx_clineno = 0;
4803 __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
4804
4805 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":807
4806 *
4807 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
4808 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
4809 *
4810 * cdef inline tuple PyDataType_SHAPE(dtype d):
4811*/
4812 __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 807, __pyx_L1_error)
4813 __Pyx_GOTREF(__pyx_t_1);
4814 {
4815 PyObject *__pyx_temp;
4816 {
4817 __pyx_temp = __pyx_r;
4818 __pyx_r = __pyx_t_1;
4819 }
4820 __Pyx_XDECREF(__pyx_temp);
4821 }
4822 __pyx_t_1 = 0;
4823 goto __pyx_L0;
4824
4825 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":806
4826 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
4827 *
4828 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
4829 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
4830 *
4831*/
4832
4833 /* function exit code */
4834 __pyx_L1_error:;
4835 __Pyx_XDECREF(__pyx_t_1);
4836 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
4837 __pyx_r = 0;
4838 __pyx_L0:;
4839 __Pyx_XGIVEREF(__pyx_r);
4840 __Pyx_RefNannyFinishContext();
4841 return __pyx_r;
4842}
4843
4844/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":809
4845 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
4846 *
4847 * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
4848 * if PyDataType_HASSUBARRAY(d):
4849 * return <tuple>d.subarray.shape
4850*/
4851
4852static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
4853 PyObject *__pyx_r = NULL;
4854 __Pyx_RefNannyDeclarations
4855 int __pyx_t_1;
4856 PyObject *__pyx_t_2;
4857 __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
4858
4859 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":810
4860 *
4861 * cdef inline tuple PyDataType_SHAPE(dtype d):
4862 * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
4863 * return <tuple>d.subarray.shape
4864 * else:
4865*/
4866 __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d);
4867
4868 if (__pyx_t_1) {
4869
4870
4871 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":811
4872 * cdef inline tuple PyDataType_SHAPE(dtype d):
4873 * if PyDataType_HASSUBARRAY(d):
4874 * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
4875 * else:
4876 * return ()
4877*/
4878 __pyx_t_2 = __pyx_f_5numpy_5dtype_8subarray___get__(__pyx_v_d)->shape;
4879
4880 {
4881 PyObject *__pyx_temp;
4882 {
4883 __pyx_temp = __pyx_r;
4884 __Pyx_INCREF(((PyObject*)__pyx_t_2));
4885 __pyx_r = ((PyObject*)__pyx_t_2);
4886 }
4887 __Pyx_XDECREF(__pyx_temp);
4888 }
4889
4890 goto __pyx_L0;
4891
4892 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":810
4893 *
4894 * cdef inline tuple PyDataType_SHAPE(dtype d):
4895 * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
4896 * return <tuple>d.subarray.shape
4897 * else:
4898*/
4899 }
4900
4901 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":813
4902 * return <tuple>d.subarray.shape
4903 * else:
4904 * return () # <<<<<<<<<<<<<<
4905 *
4906 *
4907*/
4908 /*else*/ {
4909 {
4910 PyObject *__pyx_temp;
4911 {
4912 __pyx_temp = __pyx_r;
4913 __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
4914 __pyx_r = __pyx_mstate_global->__pyx_empty_tuple;
4915 }
4916 __Pyx_XDECREF(__pyx_temp);
4917 }
4918 goto __pyx_L0;
4919 }
4920
4921 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":809
4922 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
4923 *
4924 * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
4925 * if PyDataType_HASSUBARRAY(d):
4926 * return <tuple>d.subarray.shape
4927*/
4928
4929 /* function exit code */
4930 __pyx_L0:;
4931 __Pyx_XGIVEREF(__pyx_r);
4932 __Pyx_RefNannyFinishContext();
4933 return __pyx_r;
4934}
4935
4936/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":947
4937 *
4938 * ctypedef class numpy.ufunc [object PyUFuncObject, check_size ignore]:
4939 * @property # <<<<<<<<<<<<<<
4940 * cdef inline int nin(self) noexcept nogil:
4941 * return _PyUFuncObject_GET_ITEM_DATA(self).nin
4942*/
4943
4944static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_3nin___get__(PyUFuncObject *__pyx_v_self) {
4945 int __pyx_r;
4946
4947 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":949
4948 * @property
4949 * cdef inline int nin(self) noexcept nogil:
4950 * return _PyUFuncObject_GET_ITEM_DATA(self).nin # <<<<<<<<<<<<<<
4951 *
4952 * @property
4953*/
4954 {
4955
4956 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nin;
4957 }
4958 goto __pyx_L0;
4959
4960 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":947
4961 *
4962 * ctypedef class numpy.ufunc [object PyUFuncObject, check_size ignore]:
4963 * @property # <<<<<<<<<<<<<<
4964 * cdef inline int nin(self) noexcept nogil:
4965 * return _PyUFuncObject_GET_ITEM_DATA(self).nin
4966*/
4967
4968 /* function exit code */
4969 __pyx_L0:;
4970 return __pyx_r;
4971}
4972
4973/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":951
4974 * return _PyUFuncObject_GET_ITEM_DATA(self).nin
4975 *
4976 * @property # <<<<<<<<<<<<<<
4977 * cdef inline int nout(self) noexcept nogil:
4978 * return _PyUFuncObject_GET_ITEM_DATA(self).nout
4979*/
4980
4981static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_4nout___get__(PyUFuncObject *__pyx_v_self) {
4982 int __pyx_r;
4983
4984 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":953
4985 * @property
4986 * cdef inline int nout(self) noexcept nogil:
4987 * return _PyUFuncObject_GET_ITEM_DATA(self).nout # <<<<<<<<<<<<<<
4988 *
4989 * @property
4990*/
4991 {
4992
4993 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nout;
4994 }
4995 goto __pyx_L0;
4996
4997 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":951
4998 * return _PyUFuncObject_GET_ITEM_DATA(self).nin
4999 *
5000 * @property # <<<<<<<<<<<<<<
5001 * cdef inline int nout(self) noexcept nogil:
5002 * return _PyUFuncObject_GET_ITEM_DATA(self).nout
5003*/
5004
5005 /* function exit code */
5006 __pyx_L0:;
5007 return __pyx_r;
5008}
5009
5010/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":955
5011 * return _PyUFuncObject_GET_ITEM_DATA(self).nout
5012 *
5013 * @property # <<<<<<<<<<<<<<
5014 * cdef inline int nargs(self) noexcept nogil:
5015 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs
5016*/
5017
5018static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_5nargs___get__(PyUFuncObject *__pyx_v_self) {
5019 int __pyx_r;
5020
5021 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":957
5022 * @property
5023 * cdef inline int nargs(self) noexcept nogil:
5024 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs # <<<<<<<<<<<<<<
5025 *
5026 * @property
5027*/
5028 {
5029
5030 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nargs;
5031 }
5032 goto __pyx_L0;
5033
5034 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":955
5035 * return _PyUFuncObject_GET_ITEM_DATA(self).nout
5036 *
5037 * @property # <<<<<<<<<<<<<<
5038 * cdef inline int nargs(self) noexcept nogil:
5039 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs
5040*/
5041
5042 /* function exit code */
5043 __pyx_L0:;
5044 return __pyx_r;
5045}
5046
5047/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":959
5048 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs
5049 *
5050 * @property # <<<<<<<<<<<<<<
5051 * cdef inline PyUFuncGenericFunction* functions(self) noexcept nogil:
5052 * return _PyUFuncObject_GET_ITEM_DATA(self).functions
5053*/
5054
5055static CYTHON_INLINE PyUFuncGenericFunction *__pyx_f_5numpy_5ufunc_9functions___get__(PyUFuncObject *__pyx_v_self) {
5056 PyUFuncGenericFunction *__pyx_r;
5057
5058 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":961
5059 * @property
5060 * cdef inline PyUFuncGenericFunction* functions(self) noexcept nogil:
5061 * return _PyUFuncObject_GET_ITEM_DATA(self).functions # <<<<<<<<<<<<<<
5062 *
5063 * @property
5064*/
5065 {
5066
5067 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->functions;
5068 }
5069 goto __pyx_L0;
5070
5071 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":959
5072 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs
5073 *
5074 * @property # <<<<<<<<<<<<<<
5075 * cdef inline PyUFuncGenericFunction* functions(self) noexcept nogil:
5076 * return _PyUFuncObject_GET_ITEM_DATA(self).functions
5077*/
5078
5079 /* function exit code */
5080 __pyx_L0:;
5081 return __pyx_r;
5082}
5083
5084/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":963
5085 * return _PyUFuncObject_GET_ITEM_DATA(self).functions
5086 *
5087 * @property # <<<<<<<<<<<<<<
5088 * cdef inline void ** data(self) noexcept nogil:
5089 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data
5090*/
5091
5092static CYTHON_INLINE void **__pyx_f_5numpy_5ufunc_4data___get__(PyUFuncObject *__pyx_v_self) {
5093 void **__pyx_r;
5094
5095 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":965
5096 * @property
5097 * cdef inline void ** data(self) noexcept nogil:
5098 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data # <<<<<<<<<<<<<<
5099 *
5100 * @property
5101*/
5102 {
5103
5104 __pyx_r = ((void **)_PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->data);
5105 }
5106 goto __pyx_L0;
5107
5108 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":963
5109 * return _PyUFuncObject_GET_ITEM_DATA(self).functions
5110 *
5111 * @property # <<<<<<<<<<<<<<
5112 * cdef inline void ** data(self) noexcept nogil:
5113 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data
5114*/
5115
5116 /* function exit code */
5117 __pyx_L0:;
5118 return __pyx_r;
5119}
5120
5121/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":967
5122 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data
5123 *
5124 * @property # <<<<<<<<<<<<<<
5125 * cdef inline int ntypes(self) noexcept nogil:
5126 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes
5127*/
5128
5129static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_6ntypes___get__(PyUFuncObject *__pyx_v_self) {
5130 int __pyx_r;
5131
5132 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":969
5133 * @property
5134 * cdef inline int ntypes(self) noexcept nogil:
5135 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes # <<<<<<<<<<<<<<
5136 *
5137 * @property
5138*/
5139 {
5140
5141 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->ntypes;
5142 }
5143 goto __pyx_L0;
5144
5145 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":967
5146 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data
5147 *
5148 * @property # <<<<<<<<<<<<<<
5149 * cdef inline int ntypes(self) noexcept nogil:
5150 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes
5151*/
5152
5153 /* function exit code */
5154 __pyx_L0:;
5155 return __pyx_r;
5156}
5157
5158/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":971
5159 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes
5160 *
5161 * @property # <<<<<<<<<<<<<<
5162 * cdef inline const char* name(self) noexcept nogil:
5163 * return _PyUFuncObject_GET_ITEM_DATA(self).name
5164*/
5165
5166static CYTHON_INLINE char const *__pyx_f_5numpy_5ufunc_4name___get__(PyUFuncObject *__pyx_v_self) {
5167 char const *__pyx_r;
5168
5169 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":973
5170 * @property
5171 * cdef inline const char* name(self) noexcept nogil:
5172 * return _PyUFuncObject_GET_ITEM_DATA(self).name # <<<<<<<<<<<<<<
5173 *
5174 * @property
5175*/
5176 {
5177
5178 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->name;
5179 }
5180 goto __pyx_L0;
5181
5182 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":971
5183 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes
5184 *
5185 * @property # <<<<<<<<<<<<<<
5186 * cdef inline const char* name(self) noexcept nogil:
5187 * return _PyUFuncObject_GET_ITEM_DATA(self).name
5188*/
5189
5190 /* function exit code */
5191 __pyx_L0:;
5192 return __pyx_r;
5193}
5194
5195/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":975
5196 * return _PyUFuncObject_GET_ITEM_DATA(self).name
5197 *
5198 * @property # <<<<<<<<<<<<<<
5199 * cdef inline const char* doc(self) noexcept nogil:
5200 * return _PyUFuncObject_GET_ITEM_DATA(self).doc
5201*/
5202
5203static CYTHON_INLINE char const *__pyx_f_5numpy_5ufunc_3doc___get__(PyUFuncObject *__pyx_v_self) {
5204 char const *__pyx_r;
5205
5206 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":977
5207 * @property
5208 * cdef inline const char* doc(self) noexcept nogil:
5209 * return _PyUFuncObject_GET_ITEM_DATA(self).doc # <<<<<<<<<<<<<<
5210 *
5211 * @property
5212*/
5213 {
5214
5215 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->doc;
5216 }
5217 goto __pyx_L0;
5218
5219 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":975
5220 * return _PyUFuncObject_GET_ITEM_DATA(self).name
5221 *
5222 * @property # <<<<<<<<<<<<<<
5223 * cdef inline const char* doc(self) noexcept nogil:
5224 * return _PyUFuncObject_GET_ITEM_DATA(self).doc
5225*/
5226
5227 /* function exit code */
5228 __pyx_L0:;
5229 return __pyx_r;
5230}
5231
5232/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":979
5233 * return _PyUFuncObject_GET_ITEM_DATA(self).doc
5234 *
5235 * @property # <<<<<<<<<<<<<<
5236 * cdef inline void* ptr(self) noexcept nogil:
5237 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr
5238*/
5239
5240static CYTHON_INLINE void *__pyx_f_5numpy_5ufunc_3ptr___get__(PyUFuncObject *__pyx_v_self) {
5241 void *__pyx_r;
5242
5243 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":981
5244 * @property
5245 * cdef inline void* ptr(self) noexcept nogil:
5246 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr # <<<<<<<<<<<<<<
5247 *
5248 * @property
5249*/
5250 {
5251
5252 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->ptr;
5253 }
5254 goto __pyx_L0;
5255
5256 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":979
5257 * return _PyUFuncObject_GET_ITEM_DATA(self).doc
5258 *
5259 * @property # <<<<<<<<<<<<<<
5260 * cdef inline void* ptr(self) noexcept nogil:
5261 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr
5262*/
5263
5264 /* function exit code */
5265 __pyx_L0:;
5266 return __pyx_r;
5267}
5268
5269/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":983
5270 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr
5271 *
5272 * @property # <<<<<<<<<<<<<<
5273 * cdef inline PyObject* obj(self) noexcept nogil:
5274 * return _PyUFuncObject_GET_ITEM_DATA(self).obj
5275*/
5276
5277static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_3obj___get__(PyUFuncObject *__pyx_v_self) {
5278 PyObject *__pyx_r;
5279
5280 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":985
5281 * @property
5282 * cdef inline PyObject* obj(self) noexcept nogil:
5283 * return _PyUFuncObject_GET_ITEM_DATA(self).obj # <<<<<<<<<<<<<<
5284 *
5285 * @property
5286*/
5287 {
5288
5289 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->obj;
5290 }
5291 goto __pyx_L0;
5292
5293 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":983
5294 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr
5295 *
5296 * @property # <<<<<<<<<<<<<<
5297 * cdef inline PyObject* obj(self) noexcept nogil:
5298 * return _PyUFuncObject_GET_ITEM_DATA(self).obj
5299*/
5300
5301 /* function exit code */
5302 __pyx_L0:;
5303 return __pyx_r;
5304}
5305
5306/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":987
5307 * return _PyUFuncObject_GET_ITEM_DATA(self).obj
5308 *
5309 * @property # <<<<<<<<<<<<<<
5310 * cdef inline PyObject* userloops(self) noexcept nogil:
5311 * return _PyUFuncObject_GET_ITEM_DATA(self).userloops
5312*/
5313
5314static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_9userloops___get__(PyUFuncObject *__pyx_v_self) {
5315 PyObject *__pyx_r;
5316
5317 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":989
5318 * @property
5319 * cdef inline PyObject* userloops(self) noexcept nogil:
5320 * return _PyUFuncObject_GET_ITEM_DATA(self).userloops # <<<<<<<<<<<<<<
5321 *
5322 * PyUFuncObject_fields *_PyUFuncObject_GET_ITEM_DATA(ufunc) nogil
5323*/
5324 {
5325
5326 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->userloops;
5327 }
5328 goto __pyx_L0;
5329
5330 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":987
5331 * return _PyUFuncObject_GET_ITEM_DATA(self).obj
5332 *
5333 * @property # <<<<<<<<<<<<<<
5334 * cdef inline PyObject* userloops(self) noexcept nogil:
5335 * return _PyUFuncObject_GET_ITEM_DATA(self).userloops
5336*/
5337
5338 /* function exit code */
5339 __pyx_L0:;
5340 return __pyx_r;
5341}
5342
5343/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1065
5344 * int _import_umath() except -1
5345 *
5346 * cdef inline void set_array_base(ndarray arr, object base) except *: # <<<<<<<<<<<<<<
5347 * Py_INCREF(base) # important to do this before stealing the reference below!
5348 * PyArray_SetBaseObject(arr, base)
5349*/
5350
5351static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
5352 int __pyx_t_1;
5353 int __pyx_lineno = 0;
5354 const char *__pyx_filename = NULL;
5355 int __pyx_clineno = 0;
5356
5357 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1066
5358 *
5359 * cdef inline void set_array_base(ndarray arr, object base) except *:
5360 * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
5361 * PyArray_SetBaseObject(arr, base)
5362 *
5363*/
5364 Py_INCREF(__pyx_v_base);
5365
5366 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1067
5367 * cdef inline void set_array_base(ndarray arr, object base) except *:
5368 * Py_INCREF(base) # important to do this before stealing the reference below!
5369 * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
5370 *
5371 * cdef inline object get_array_base(ndarray arr):
5372*/
5373 __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1067, __pyx_L1_error)
5374
5375
5376 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1065
5377 * int _import_umath() except -1
5378 *
5379 * cdef inline void set_array_base(ndarray arr, object base) except *: # <<<<<<<<<<<<<<
5380 * Py_INCREF(base) # important to do this before stealing the reference below!
5381 * PyArray_SetBaseObject(arr, base)
5382*/
5383
5384 /* function exit code */
5385 goto __pyx_L0;
5386 __pyx_L1_error:;
5387 __Pyx_AddTraceback("numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
5388 __pyx_L0:;
5389
5390}
5391
5392/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1069
5393 * PyArray_SetBaseObject(arr, base)
5394 *
5395 * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
5396 * base = PyArray_BASE(arr)
5397 * if base is NULL:
5398*/
5399
5400static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
5401 PyObject *__pyx_v_base;
5402 PyObject *__pyx_r = NULL;
5403 __Pyx_RefNannyDeclarations
5404 int __pyx_t_1;
5405 __Pyx_RefNannySetupContext("get_array_base", 0);
5406
5407 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1070
5408 *
5409 * cdef inline object get_array_base(ndarray arr):
5410 * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
5411 * if base is NULL:
5412 * return None
5413*/
5414 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
5415
5416 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1071
5417 * cdef inline object get_array_base(ndarray arr):
5418 * base = PyArray_BASE(arr)
5419 * if base is NULL: # <<<<<<<<<<<<<<
5420 * return None
5421 * return <object>base
5422*/
5423 __pyx_t_1 = (__pyx_v_base == NULL);
5424
5425 if (__pyx_t_1) {
5426
5427
5428 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1072
5429 * base = PyArray_BASE(arr)
5430 * if base is NULL:
5431 * return None # <<<<<<<<<<<<<<
5432 * return <object>base
5433 *
5434*/
5435 {
5436 PyObject *__pyx_temp;
5437 {
5438 __pyx_temp = __pyx_r;
5439 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5440 }
5441 __Pyx_XDECREF(__pyx_temp);
5442 }
5443 goto __pyx_L0;
5444
5445 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1071
5446 * cdef inline object get_array_base(ndarray arr):
5447 * base = PyArray_BASE(arr)
5448 * if base is NULL: # <<<<<<<<<<<<<<
5449 * return None
5450 * return <object>base
5451*/
5452 }
5453
5454 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1073
5455 * if base is NULL:
5456 * return None
5457 * return <object>base # <<<<<<<<<<<<<<
5458 *
5459 * # Versions of the import_* functions which are more suitable for
5460*/
5461 {
5462 PyObject *__pyx_temp;
5463 {
5464 __pyx_temp = __pyx_r;
5465 __Pyx_INCREF(((PyObject *)__pyx_v_base));
5466 __pyx_r = ((PyObject *)__pyx_v_base);
5467 }
5468 __Pyx_XDECREF(__pyx_temp);
5469 }
5470 goto __pyx_L0;
5471
5472 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1069
5473 * PyArray_SetBaseObject(arr, base)
5474 *
5475 * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
5476 * base = PyArray_BASE(arr)
5477 * if base is NULL:
5478*/
5479
5480 /* function exit code */
5481 __pyx_L0:;
5482
5483 __Pyx_XGIVEREF(__pyx_r);
5484 __Pyx_RefNannyFinishContext();
5485 return __pyx_r;
5486}
5487
5488/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1077
5489 * # Versions of the import_* functions which are more suitable for
5490 * # Cython code.
5491 * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
5492 * try:
5493 * __pyx_import_array()
5494*/
5495
5496static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
5497 int __pyx_r;
5498 __Pyx_RefNannyDeclarations
5499 PyObject *__pyx_t_1 = NULL;
5500 PyObject *__pyx_t_2 = NULL;
5501 PyObject *__pyx_t_3 = NULL;
5502 int __pyx_t_4;
5503 PyObject *__pyx_t_5 = NULL;
5504 PyObject *__pyx_t_6 = NULL;
5505 PyObject *__pyx_t_7 = NULL;
5506 PyObject *__pyx_t_8 = NULL;
5507 PyObject *__pyx_t_9 = NULL;
5508 size_t __pyx_t_10;
5509 int __pyx_lineno = 0;
5510 const char *__pyx_filename = NULL;
5511 int __pyx_clineno = 0;
5512 __Pyx_RefNannySetupContext("import_array", 0);
5513
5514 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1078
5515 * # Cython code.
5516 * cdef inline int import_array() except -1:
5517 * try: # <<<<<<<<<<<<<<
5518 * __pyx_import_array()
5519 * except Exception:
5520*/
5521 {
5522 __Pyx_PyThreadState_declare
5523 __Pyx_PyThreadState_assign
5524 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5525 __Pyx_XGOTREF(__pyx_t_1);
5526 __Pyx_XGOTREF(__pyx_t_2);
5527 __Pyx_XGOTREF(__pyx_t_3);
5528 /*try:*/ {
5529
5530 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1079
5531 * cdef inline int import_array() except -1:
5532 * try:
5533 * __pyx_import_array() # <<<<<<<<<<<<<<
5534 * except Exception:
5535 * raise ImportError("numpy._core.multiarray failed to import")
5536*/
5537 __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1079, __pyx_L3_error)
5538
5539
5540 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1078
5541 * # Cython code.
5542 * cdef inline int import_array() except -1:
5543 * try: # <<<<<<<<<<<<<<
5544 * __pyx_import_array()
5545 * except Exception:
5546*/
5547 }
5548 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5549 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5550 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5551 goto __pyx_L8_try_end;
5552 __pyx_L3_error:;
5553
5554 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1080
5555 * try:
5556 * __pyx_import_array()
5557 * except Exception: # <<<<<<<<<<<<<<
5558 * raise ImportError("numpy._core.multiarray failed to import")
5559 *
5560*/
5561 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
5562 if (__pyx_t_4) {
5563 __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
5564 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1080, __pyx_L5_except_error)
5565 __Pyx_XGOTREF(__pyx_t_5);
5566 __Pyx_XGOTREF(__pyx_t_6);
5567 __Pyx_XGOTREF(__pyx_t_7);
5568
5569 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1081
5570 * __pyx_import_array()
5571 * except Exception:
5572 * raise ImportError("numpy._core.multiarray failed to import") # <<<<<<<<<<<<<<
5573 *
5574 * cdef inline int import_umath() except -1:
5575*/
5576 __pyx_t_9 = NULL;
5577 __pyx_t_10 = 1;
5578 {
5579 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_multiarray_failed_to};
5580 __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ImportError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
5581 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5582 if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1081, __pyx_L5_except_error)
5583 __Pyx_GOTREF(__pyx_t_8);
5584 }
5585 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
5586 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5587 __PYX_ERR(1, 1081, __pyx_L5_except_error)
5588 }
5589 goto __pyx_L5_except_error;
5590
5591 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1078
5592 * # Cython code.
5593 * cdef inline int import_array() except -1:
5594 * try: # <<<<<<<<<<<<<<
5595 * __pyx_import_array()
5596 * except Exception:
5597*/
5598 __pyx_L5_except_error:;
5599 __Pyx_XGIVEREF(__pyx_t_1);
5600 __Pyx_XGIVEREF(__pyx_t_2);
5601 __Pyx_XGIVEREF(__pyx_t_3);
5602 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
5603 goto __pyx_L1_error;
5604 __pyx_L8_try_end:;
5605 }
5606
5607 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1077
5608 * # Versions of the import_* functions which are more suitable for
5609 * # Cython code.
5610 * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
5611 * try:
5612 * __pyx_import_array()
5613*/
5614
5615 /* function exit code */
5616 __pyx_r = 0;
5617 goto __pyx_L0;
5618 __pyx_L1_error:;
5619 __Pyx_XDECREF(__pyx_t_5);
5620 __Pyx_XDECREF(__pyx_t_6);
5621 __Pyx_XDECREF(__pyx_t_7);
5622 __Pyx_XDECREF(__pyx_t_8);
5623 __Pyx_XDECREF(__pyx_t_9);
5624 __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
5625 __pyx_r = -1;
5626 __pyx_L0:;
5627
5628 __Pyx_RefNannyFinishContext();
5629 return __pyx_r;
5630}
5631
5632/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1083
5633 * raise ImportError("numpy._core.multiarray failed to import")
5634 *
5635 * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
5636 * try:
5637 * _import_umath()
5638*/
5639
5640static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
5641 int __pyx_r;
5642 __Pyx_RefNannyDeclarations
5643 PyObject *__pyx_t_1 = NULL;
5644 PyObject *__pyx_t_2 = NULL;
5645 PyObject *__pyx_t_3 = NULL;
5646 int __pyx_t_4;
5647 PyObject *__pyx_t_5 = NULL;
5648 PyObject *__pyx_t_6 = NULL;
5649 PyObject *__pyx_t_7 = NULL;
5650 PyObject *__pyx_t_8 = NULL;
5651 PyObject *__pyx_t_9 = NULL;
5652 size_t __pyx_t_10;
5653 int __pyx_lineno = 0;
5654 const char *__pyx_filename = NULL;
5655 int __pyx_clineno = 0;
5656 __Pyx_RefNannySetupContext("import_umath", 0);
5657
5658 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1084
5659 *
5660 * cdef inline int import_umath() except -1:
5661 * try: # <<<<<<<<<<<<<<
5662 * _import_umath()
5663 * except Exception:
5664*/
5665 {
5666 __Pyx_PyThreadState_declare
5667 __Pyx_PyThreadState_assign
5668 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5669 __Pyx_XGOTREF(__pyx_t_1);
5670 __Pyx_XGOTREF(__pyx_t_2);
5671 __Pyx_XGOTREF(__pyx_t_3);
5672 /*try:*/ {
5673
5674 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1085
5675 * cdef inline int import_umath() except -1:
5676 * try:
5677 * _import_umath() # <<<<<<<<<<<<<<
5678 * except Exception:
5679 * raise ImportError("numpy._core.umath failed to import")
5680*/
5681 __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1085, __pyx_L3_error)
5682
5683
5684 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1084
5685 *
5686 * cdef inline int import_umath() except -1:
5687 * try: # <<<<<<<<<<<<<<
5688 * _import_umath()
5689 * except Exception:
5690*/
5691 }
5692 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5693 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5694 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5695 goto __pyx_L8_try_end;
5696 __pyx_L3_error:;
5697
5698 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1086
5699 * try:
5700 * _import_umath()
5701 * except Exception: # <<<<<<<<<<<<<<
5702 * raise ImportError("numpy._core.umath failed to import")
5703 *
5704*/
5705 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
5706 if (__pyx_t_4) {
5707 __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
5708 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1086, __pyx_L5_except_error)
5709 __Pyx_XGOTREF(__pyx_t_5);
5710 __Pyx_XGOTREF(__pyx_t_6);
5711 __Pyx_XGOTREF(__pyx_t_7);
5712
5713 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1087
5714 * _import_umath()
5715 * except Exception:
5716 * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
5717 *
5718 * cdef inline int import_ufunc() except -1:
5719*/
5720 __pyx_t_9 = NULL;
5721 __pyx_t_10 = 1;
5722 {
5723 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo};
5724 __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ImportError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
5725 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5726 if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1087, __pyx_L5_except_error)
5727 __Pyx_GOTREF(__pyx_t_8);
5728 }
5729 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
5730 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5731 __PYX_ERR(1, 1087, __pyx_L5_except_error)
5732 }
5733 goto __pyx_L5_except_error;
5734
5735 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1084
5736 *
5737 * cdef inline int import_umath() except -1:
5738 * try: # <<<<<<<<<<<<<<
5739 * _import_umath()
5740 * except Exception:
5741*/
5742 __pyx_L5_except_error:;
5743 __Pyx_XGIVEREF(__pyx_t_1);
5744 __Pyx_XGIVEREF(__pyx_t_2);
5745 __Pyx_XGIVEREF(__pyx_t_3);
5746 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
5747 goto __pyx_L1_error;
5748 __pyx_L8_try_end:;
5749 }
5750
5751 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1083
5752 * raise ImportError("numpy._core.multiarray failed to import")
5753 *
5754 * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
5755 * try:
5756 * _import_umath()
5757*/
5758
5759 /* function exit code */
5760 __pyx_r = 0;
5761 goto __pyx_L0;
5762 __pyx_L1_error:;
5763 __Pyx_XDECREF(__pyx_t_5);
5764 __Pyx_XDECREF(__pyx_t_6);
5765 __Pyx_XDECREF(__pyx_t_7);
5766 __Pyx_XDECREF(__pyx_t_8);
5767 __Pyx_XDECREF(__pyx_t_9);
5768 __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
5769 __pyx_r = -1;
5770 __pyx_L0:;
5771
5772 __Pyx_RefNannyFinishContext();
5773 return __pyx_r;
5774}
5775
5776/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1089
5777 * raise ImportError("numpy._core.umath failed to import")
5778 *
5779 * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
5780 * try:
5781 * _import_umath()
5782*/
5783
5784static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
5785 int __pyx_r;
5786 __Pyx_RefNannyDeclarations
5787 PyObject *__pyx_t_1 = NULL;
5788 PyObject *__pyx_t_2 = NULL;
5789 PyObject *__pyx_t_3 = NULL;
5790 int __pyx_t_4;
5791 PyObject *__pyx_t_5 = NULL;
5792 PyObject *__pyx_t_6 = NULL;
5793 PyObject *__pyx_t_7 = NULL;
5794 PyObject *__pyx_t_8 = NULL;
5795 PyObject *__pyx_t_9 = NULL;
5796 size_t __pyx_t_10;
5797 int __pyx_lineno = 0;
5798 const char *__pyx_filename = NULL;
5799 int __pyx_clineno = 0;
5800 __Pyx_RefNannySetupContext("import_ufunc", 0);
5801
5802 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1090
5803 *
5804 * cdef inline int import_ufunc() except -1:
5805 * try: # <<<<<<<<<<<<<<
5806 * _import_umath()
5807 * except Exception:
5808*/
5809 {
5810 __Pyx_PyThreadState_declare
5811 __Pyx_PyThreadState_assign
5812 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5813 __Pyx_XGOTREF(__pyx_t_1);
5814 __Pyx_XGOTREF(__pyx_t_2);
5815 __Pyx_XGOTREF(__pyx_t_3);
5816 /*try:*/ {
5817
5818 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1091
5819 * cdef inline int import_ufunc() except -1:
5820 * try:
5821 * _import_umath() # <<<<<<<<<<<<<<
5822 * except Exception:
5823 * raise ImportError("numpy._core.umath failed to import")
5824*/
5825 __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1091, __pyx_L3_error)
5826
5827
5828 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1090
5829 *
5830 * cdef inline int import_ufunc() except -1:
5831 * try: # <<<<<<<<<<<<<<
5832 * _import_umath()
5833 * except Exception:
5834*/
5835 }
5836 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5837 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5838 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5839 goto __pyx_L8_try_end;
5840 __pyx_L3_error:;
5841
5842 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1092
5843 * try:
5844 * _import_umath()
5845 * except Exception: # <<<<<<<<<<<<<<
5846 * raise ImportError("numpy._core.umath failed to import")
5847 *
5848*/
5849 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
5850 if (__pyx_t_4) {
5851 __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
5852 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1092, __pyx_L5_except_error)
5853 __Pyx_XGOTREF(__pyx_t_5);
5854 __Pyx_XGOTREF(__pyx_t_6);
5855 __Pyx_XGOTREF(__pyx_t_7);
5856
5857 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1093
5858 * _import_umath()
5859 * except Exception:
5860 * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
5861 *
5862 *
5863*/
5864 __pyx_t_9 = NULL;
5865 __pyx_t_10 = 1;
5866 {
5867 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo};
5868 __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ImportError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
5869 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5870 if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1093, __pyx_L5_except_error)
5871 __Pyx_GOTREF(__pyx_t_8);
5872 }
5873 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
5874 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5875 __PYX_ERR(1, 1093, __pyx_L5_except_error)
5876 }
5877 goto __pyx_L5_except_error;
5878
5879 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1090
5880 *
5881 * cdef inline int import_ufunc() except -1:
5882 * try: # <<<<<<<<<<<<<<
5883 * _import_umath()
5884 * except Exception:
5885*/
5886 __pyx_L5_except_error:;
5887 __Pyx_XGIVEREF(__pyx_t_1);
5888 __Pyx_XGIVEREF(__pyx_t_2);
5889 __Pyx_XGIVEREF(__pyx_t_3);
5890 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
5891 goto __pyx_L1_error;
5892 __pyx_L8_try_end:;
5893 }
5894
5895 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1089
5896 * raise ImportError("numpy._core.umath failed to import")
5897 *
5898 * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
5899 * try:
5900 * _import_umath()
5901*/
5902
5903 /* function exit code */
5904 __pyx_r = 0;
5905 goto __pyx_L0;
5906 __pyx_L1_error:;
5907 __Pyx_XDECREF(__pyx_t_5);
5908 __Pyx_XDECREF(__pyx_t_6);
5909 __Pyx_XDECREF(__pyx_t_7);
5910 __Pyx_XDECREF(__pyx_t_8);
5911 __Pyx_XDECREF(__pyx_t_9);
5912 __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
5913 __pyx_r = -1;
5914 __pyx_L0:;
5915
5916 __Pyx_RefNannyFinishContext();
5917 return __pyx_r;
5918}
5919
5920/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1096
5921 *
5922 *
5923 * cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<<
5924 * """
5925 * Cython equivalent of `isinstance(obj, np.timedelta64)`
5926*/
5927
5928static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
5929 int __pyx_r;
5930
5931 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1108
5932 * bool
5933 * """
5934 * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<<
5935 *
5936 *
5937*/
5938 {
5939
5940 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
5941 }
5942 goto __pyx_L0;
5943
5944 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1096
5945 *
5946 *
5947 * cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<<
5948 * """
5949 * Cython equivalent of `isinstance(obj, np.timedelta64)`
5950*/
5951
5952 /* function exit code */
5953 __pyx_L0:;
5954
5955 return __pyx_r;
5956}
5957
5958/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1111
5959 *
5960 *
5961 * cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<<
5962 * """
5963 * Cython equivalent of `isinstance(obj, np.datetime64)`
5964*/
5965
5966static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
5967 int __pyx_r;
5968
5969 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1123
5970 * bool
5971 * """
5972 * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<<
5973 *
5974 *
5975*/
5976 {
5977
5978 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
5979 }
5980 goto __pyx_L0;
5981
5982 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1111
5983 *
5984 *
5985 * cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<<
5986 * """
5987 * Cython equivalent of `isinstance(obj, np.datetime64)`
5988*/
5989
5990 /* function exit code */
5991 __pyx_L0:;
5992
5993 return __pyx_r;
5994}
5995
5996/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1126
5997 *
5998 *
5999 * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
6000 * """
6001 * returns the int64 value underlying scalar numpy datetime64 object
6002*/
6003
6004static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
6005 npy_datetime __pyx_r;
6006
6007 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1133
6008 * also needed. That can be found using `get_datetime64_unit`.
6009 * """
6010 * return _PyDatetimeScalarObject_GetValue(obj) # <<<<<<<<<<<<<<
6011 *
6012 *
6013*/
6014 {
6015
6016 __pyx_r = _PyDatetimeScalarObject_GetValue(__pyx_v_obj);
6017 }
6018 goto __pyx_L0;
6019
6020 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1126
6021 *
6022 *
6023 * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
6024 * """
6025 * returns the int64 value underlying scalar numpy datetime64 object
6026*/
6027
6028 /* function exit code */
6029 __pyx_L0:;
6030 return __pyx_r;
6031}
6032
6033/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1136
6034 *
6035 *
6036 * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
6037 * """
6038 * returns the int64 value underlying scalar numpy timedelta64 object
6039*/
6040
6041static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
6042 npy_timedelta __pyx_r;
6043
6044 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1140
6045 * returns the int64 value underlying scalar numpy timedelta64 object
6046 * """
6047 * return _PyTimedeltaScalarObject_GetValue(obj) # <<<<<<<<<<<<<<
6048 *
6049 *
6050*/
6051 {
6052
6053 __pyx_r = _PyTimedeltaScalarObject_GetValue(__pyx_v_obj);
6054 }
6055 goto __pyx_L0;
6056
6057 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1136
6058 *
6059 *
6060 * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
6061 * """
6062 * returns the int64 value underlying scalar numpy timedelta64 object
6063*/
6064
6065 /* function exit code */
6066 __pyx_L0:;
6067 return __pyx_r;
6068}
6069
6070/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1143
6071 *
6072 *
6073 * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil: # <<<<<<<<<<<<<<
6074 * """
6075 * returns the unit part of the dtype for a numpy datetime64 object.
6076*/
6077
6078static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
6079 NPY_DATETIMEUNIT __pyx_r;
6080
6081 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1147
6082 * returns the unit part of the dtype for a numpy datetime64 object.
6083 * """
6084 * return _PyDatetimeScalarObject_GetMetadata(obj).base # <<<<<<<<<<<<<<
6085 *
6086 *
6087*/
6088 {
6089
6090 __pyx_r = _PyDatetimeScalarObject_GetMetadata(__pyx_v_obj).base;
6091 }
6092 goto __pyx_L0;
6093
6094 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1143
6095 *
6096 *
6097 * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil: # <<<<<<<<<<<<<<
6098 * """
6099 * returns the unit part of the dtype for a numpy datetime64 object.
6100*/
6101
6102 /* function exit code */
6103 __pyx_L0:;
6104 return __pyx_r;
6105}
6106
6107/* "fenton/Fenton.pyx":17
6108 * cdef void runfourier()
6109 *
6110 * def writeInput(waveheight, # <<<<<<<<<<<<<<
6111 * depth,
6112 * period=None,
6113*/
6114
6115/* Python wrapper */
6116static PyObject *__pyx_pw_6fenton_6Fenton_1writeInput(PyObject *__pyx_self,
6117#if CYTHON_VECTORCALL
6118PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6119#else
6120PyObject *__pyx_args, PyObject *__pyx_kwds
6121#endif
6122); /*proto*/
6123PyDoc_STRVAR(__pyx_doc_6fenton_6Fenton_writeInput, "\n Creates input files for Fourier script\n\n Parameters\n ----------\n waveheight: double\n Height of wave\n depth: double\n Water depth\n period: double\n Wave period\n mode: string\n \047Period\047 or \047Wavelength\047\n current_criterion: int\n 1: Euler, 2: Stokes\n current_magnitude: double\n Magnitude of current\n ncoeffs: int\n Number of Fourier coefficients\n height_steps: int\n Number of height steps to reach H/d\n g: double\n Gravity\n niter: int\n Max number of iterations \n conv_crit: double\n Criterion for convergence\n points_freesurface: int\n Number of points on free surface\n points_velocity: int\n Number of velocity/acceleration profiles to print out\n points_vertical: int\n Number of vertical points in each profile\n ");
6124static PyMethodDef __pyx_mdef_6fenton_6Fenton_1writeInput = {"writeInput", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6fenton_6Fenton_1writeInput, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6fenton_6Fenton_writeInput};
6125static PyObject *__pyx_pw_6fenton_6Fenton_1writeInput(PyObject *__pyx_self,
6126#if CYTHON_VECTORCALL
6127PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6128#else
6129PyObject *__pyx_args, PyObject *__pyx_kwds
6130#endif
6131) {
6132 PyObject *__pyx_v_waveheight = 0;
6133 PyObject *__pyx_v_depth = 0;
6134 PyObject *__pyx_v_period = 0;
6135 PyObject *__pyx_v_wavelength = 0;
6136 PyObject *__pyx_v_mode = 0;
6137 PyObject *__pyx_v_current_criterion = 0;
6138 PyObject *__pyx_v_current_magnitude = 0;
6139 PyObject *__pyx_v_ncoeffs = 0;
6140 PyObject *__pyx_v_height_steps = 0;
6141 PyObject *__pyx_v_g = 0;
6142 PyObject *__pyx_v_niter = 0;
6143 PyObject *__pyx_v_conv_crit = 0;
6144 CYTHON_UNUSED PyObject *__pyx_v_points_freesurface = 0;
6145 CYTHON_UNUSED PyObject *__pyx_v_points_velocity = 0;
6146 CYTHON_UNUSED PyObject *__pyx_v_points_vertical = 0;
6147 #if !CYTHON_VECTORCALL
6148 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6149 #endif
6150 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6151 PyObject* values[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
6152 int __pyx_lineno = 0;
6153 const char *__pyx_filename = NULL;
6154 int __pyx_clineno = 0;
6155 PyObject *__pyx_r = 0;
6156 __Pyx_RefNannyDeclarations
6157 __Pyx_RefNannySetupContext("writeInput (wrapper)", 0);
6158 #if !CYTHON_VECTORCALL
6159 #if CYTHON_ASSUME_SAFE_SIZE
6160 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6161 #else
6162 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
6163 #endif
6164 #endif
6165 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6166 {
6167 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_waveheight,&__pyx_mstate_global->__pyx_n_u_depth,&__pyx_mstate_global->__pyx_n_u_period,&__pyx_mstate_global->__pyx_n_u_wavelength,&__pyx_mstate_global->__pyx_n_u_mode,&__pyx_mstate_global->__pyx_n_u_current_criterion,&__pyx_mstate_global->__pyx_n_u_current_magnitude,&__pyx_mstate_global->__pyx_n_u_ncoeffs,&__pyx_mstate_global->__pyx_n_u_height_steps,&__pyx_mstate_global->__pyx_n_u_g,&__pyx_mstate_global->__pyx_n_u_niter,&__pyx_mstate_global->__pyx_n_u_conv_crit,&__pyx_mstate_global->__pyx_n_u_points_freesurface,&__pyx_mstate_global->__pyx_n_u_points_velocity,&__pyx_mstate_global->__pyx_n_u_points_vertical,0};
6168 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
6169 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 17, __pyx_L3_error)
6170 if (__pyx_kwds_len > 0) {
6171 switch (__pyx_nargs) {
6172 case 15:
6173 values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
6174 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 17, __pyx_L3_error)
6175 CYTHON_FALLTHROUGH;
6176 case 14:
6177 values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
6178 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 17, __pyx_L3_error)
6179 CYTHON_FALLTHROUGH;
6180 case 13:
6181 values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
6182 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 17, __pyx_L3_error)
6183 CYTHON_FALLTHROUGH;
6184 case 12:
6185 values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
6186 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 17, __pyx_L3_error)
6187 CYTHON_FALLTHROUGH;
6188 case 11:
6189 values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
6190 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 17, __pyx_L3_error)
6191 CYTHON_FALLTHROUGH;
6192 case 10:
6193 values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
6194 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 17, __pyx_L3_error)
6195 CYTHON_FALLTHROUGH;
6196 case 9:
6197 values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
6198 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 17, __pyx_L3_error)
6199 CYTHON_FALLTHROUGH;
6200 case 8:
6201 values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
6202 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 17, __pyx_L3_error)
6203 CYTHON_FALLTHROUGH;
6204 case 7:
6205 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
6206 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 17, __pyx_L3_error)
6207 CYTHON_FALLTHROUGH;
6208 case 6:
6209 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
6210 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 17, __pyx_L3_error)
6211 CYTHON_FALLTHROUGH;
6212 case 5:
6213 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
6214 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 17, __pyx_L3_error)
6215 CYTHON_FALLTHROUGH;
6216 case 4:
6217 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
6218 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 17, __pyx_L3_error)
6219 CYTHON_FALLTHROUGH;
6220 case 3:
6221 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
6222 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 17, __pyx_L3_error)
6223 CYTHON_FALLTHROUGH;
6224 case 2:
6225 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
6226 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 17, __pyx_L3_error)
6227 CYTHON_FALLTHROUGH;
6228 case 1:
6229 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6230 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 17, __pyx_L3_error)
6231 CYTHON_FALLTHROUGH;
6232 case 0: break;
6233 default: goto __pyx_L5_argtuple_error;
6234 }
6235 const Py_ssize_t kwd_pos_args = __pyx_nargs;
6236 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "writeInput", 0) < (0)) __PYX_ERR(0, 17, __pyx_L3_error)
6237
6238 /* "fenton/Fenton.pyx":19
6239 * def writeInput(waveheight,
6240 * depth,
6241 * period=None, # <<<<<<<<<<<<<<
6242 * wavelength=None,
6243 * mode='Period',
6244*/
6245 if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
6246
6247 /* "fenton/Fenton.pyx":20
6248 * depth,
6249 * period=None,
6250 * wavelength=None, # <<<<<<<<<<<<<<
6251 * mode='Period',
6252 * current_criterion=1,
6253*/
6254 if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
6255 if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_n_u_Period)));
6256 if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_1)));
6257 if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_0)));
6258 if (!values[7]) values[7] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_8)));
6259 if (!values[8]) values[8] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_1)));
6260 if (!values[9]) values[9] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_float_9_81)));
6261 if (!values[10]) values[10] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_40)));
6262 if (!values[11]) values[11] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_float_1_eneg_05)));
6263 if (!values[12]) values[12] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_50)));
6264 if (!values[13]) values[13] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_16)));
6265 if (!values[14]) values[14] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_20)));
6266 for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
6267 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("writeInput", 0, 2, 15, i); __PYX_ERR(0, 17, __pyx_L3_error) }
6268 }
6269 } else {
6270 switch (__pyx_nargs) {
6271 case 15:
6272 values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
6273 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 17, __pyx_L3_error)
6274 CYTHON_FALLTHROUGH;
6275 case 14:
6276 values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
6277 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 17, __pyx_L3_error)
6278 CYTHON_FALLTHROUGH;
6279 case 13:
6280 values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
6281 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 17, __pyx_L3_error)
6282 CYTHON_FALLTHROUGH;
6283 case 12:
6284 values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
6285 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 17, __pyx_L3_error)
6286 CYTHON_FALLTHROUGH;
6287 case 11:
6288 values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
6289 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 17, __pyx_L3_error)
6290 CYTHON_FALLTHROUGH;
6291 case 10:
6292 values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
6293 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 17, __pyx_L3_error)
6294 CYTHON_FALLTHROUGH;
6295 case 9:
6296 values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
6297 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 17, __pyx_L3_error)
6298 CYTHON_FALLTHROUGH;
6299 case 8:
6300 values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
6301 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 17, __pyx_L3_error)
6302 CYTHON_FALLTHROUGH;
6303 case 7:
6304 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
6305 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 17, __pyx_L3_error)
6306 CYTHON_FALLTHROUGH;
6307 case 6:
6308 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
6309 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 17, __pyx_L3_error)
6310 CYTHON_FALLTHROUGH;
6311 case 5:
6312 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
6313 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 17, __pyx_L3_error)
6314 CYTHON_FALLTHROUGH;
6315 case 4:
6316 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
6317 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 17, __pyx_L3_error)
6318 CYTHON_FALLTHROUGH;
6319 case 3:
6320 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
6321 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 17, __pyx_L3_error)
6322 CYTHON_FALLTHROUGH;
6323 case 2:
6324 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
6325 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 17, __pyx_L3_error)
6326 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6327 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 17, __pyx_L3_error)
6328 break;
6329 default: goto __pyx_L5_argtuple_error;
6330 }
6331
6332 /* "fenton/Fenton.pyx":19
6333 * def writeInput(waveheight,
6334 * depth,
6335 * period=None, # <<<<<<<<<<<<<<
6336 * wavelength=None,
6337 * mode='Period',
6338*/
6339 if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
6340
6341 /* "fenton/Fenton.pyx":20
6342 * depth,
6343 * period=None,
6344 * wavelength=None, # <<<<<<<<<<<<<<
6345 * mode='Period',
6346 * current_criterion=1,
6347*/
6348 if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
6349 if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_n_u_Period)));
6350 if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_1)));
6351 if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_0)));
6352 if (!values[7]) values[7] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_8)));
6353 if (!values[8]) values[8] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_1)));
6354 if (!values[9]) values[9] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_float_9_81)));
6355 if (!values[10]) values[10] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_40)));
6356 if (!values[11]) values[11] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_float_1_eneg_05)));
6357 if (!values[12]) values[12] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_50)));
6358 if (!values[13]) values[13] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_16)));
6359 if (!values[14]) values[14] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_20)));
6360 }
6361 __pyx_v_waveheight = values[0];
6362 __pyx_v_depth = values[1];
6363 __pyx_v_period = values[2];
6364 __pyx_v_wavelength = values[3];
6365 __pyx_v_mode = values[4];
6366 __pyx_v_current_criterion = values[5];
6367 __pyx_v_current_magnitude = values[6];
6368 __pyx_v_ncoeffs = values[7];
6369 __pyx_v_height_steps = values[8];
6370 __pyx_v_g = values[9];
6371 __pyx_v_niter = values[10];
6372 __pyx_v_conv_crit = values[11];
6373 __pyx_v_points_freesurface = values[12];
6374 __pyx_v_points_velocity = values[13];
6375 __pyx_v_points_vertical = values[14];
6376 }
6377 goto __pyx_L6_skip;
6378 __pyx_L5_argtuple_error:;
6379 __Pyx_RaiseArgtupleInvalid("writeInput", 0, 2, 15, __pyx_nargs); __PYX_ERR(0, 17, __pyx_L3_error)
6380 __pyx_L6_skip:;
6381 goto __pyx_L4_argument_unpacking_done;
6382 __pyx_L3_error:;
6383 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
6384 Py_XDECREF(values[__pyx_temp]);
6385 }
6386 __Pyx_AddTraceback("fenton.Fenton.writeInput", __pyx_clineno, __pyx_lineno, __pyx_filename);
6387 __Pyx_RefNannyFinishContext();
6388 return NULL;
6389 __pyx_L4_argument_unpacking_done:;
6390 __pyx_r = __pyx_pf_6fenton_6Fenton_writeInput(__pyx_self, __pyx_v_waveheight, __pyx_v_depth, __pyx_v_period, __pyx_v_wavelength, __pyx_v_mode, __pyx_v_current_criterion, __pyx_v_current_magnitude, __pyx_v_ncoeffs, __pyx_v_height_steps, __pyx_v_g, __pyx_v_niter, __pyx_v_conv_crit, __pyx_v_points_freesurface, __pyx_v_points_velocity, __pyx_v_points_vertical);
6391
6392 /* "fenton/Fenton.pyx":17
6393 * cdef void runfourier()
6394 *
6395 * def writeInput(waveheight, # <<<<<<<<<<<<<<
6396 * depth,
6397 * period=None,
6398*/
6399
6400 /* function exit code */
6401 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
6402 Py_XDECREF(values[__pyx_temp]);
6403 }
6404 __Pyx_RefNannyFinishContext();
6405 return __pyx_r;
6406}
6407
6408static PyObject *__pyx_pf_6fenton_6Fenton_writeInput(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_waveheight, PyObject *__pyx_v_depth, PyObject *__pyx_v_period, PyObject *__pyx_v_wavelength, PyObject *__pyx_v_mode, PyObject *__pyx_v_current_criterion, PyObject *__pyx_v_current_magnitude, PyObject *__pyx_v_ncoeffs, PyObject *__pyx_v_height_steps, PyObject *__pyx_v_g, PyObject *__pyx_v_niter, PyObject *__pyx_v_conv_crit, CYTHON_UNUSED PyObject *__pyx_v_points_freesurface, CYTHON_UNUSED PyObject *__pyx_v_points_velocity, CYTHON_UNUSED PyObject *__pyx_v_points_vertical) {
6409 PyObject *__pyx_v_filename = NULL;
6410 PyObject *__pyx_v_f = NULL;
6411 PyObject *__pyx_v_waveheight_dimless = NULL;
6412 PyObject *__pyx_v_length_dimless = NULL;
6413 PyObject *__pyx_v_current_magnitude_dimless = NULL;
6414 PyObject *__pyx_r = NULL;
6415 __Pyx_RefNannyDeclarations
6416 int __pyx_t_1;
6417 int __pyx_t_2;
6418 PyObject *__pyx_t_3 = NULL;
6419 PyObject *__pyx_t_4 = NULL;
6420 size_t __pyx_t_5;
6421 PyObject *__pyx_t_6 = NULL;
6422 PyObject *__pyx_t_7 = NULL;
6423 PyObject *__pyx_t_8 = NULL;
6424 PyObject *__pyx_t_9 = NULL;
6425 PyObject *__pyx_t_10 = NULL;
6426 PyObject *__pyx_t_11 = NULL;
6427 PyObject *__pyx_t_12 = NULL;
6428 PyObject *__pyx_t_13 = NULL;
6429 int __pyx_lineno = 0;
6430 const char *__pyx_filename = NULL;
6431 int __pyx_clineno = 0;
6432 __Pyx_RefNannySetupContext("writeInput", 0);
6433 __Pyx_INCREF(__pyx_v_mode);
6434
6435 /* "fenton/Fenton.pyx":67
6436 * '''
6437 * # Data input file
6438 * assert period is not None or wavelength is not None, 'Period or wavelength must be set for Fenton wave' # <<<<<<<<<<<<<<
6439 * if period is None and wavelength is not None:
6440 * mode = 'Wavelength'
6441*/
6442 #ifndef CYTHON_WITHOUT_ASSERTIONS
6443 if (unlikely(__pyx_assertions_enabled())) {
6444 __pyx_t_2 = (__pyx_v_period != Py_None);
6445 if (!__pyx_t_2) {
6446
6447 } else {
6448
6449 __pyx_t_1 = __pyx_t_2;
6450
6451 goto __pyx_L3_bool_binop_done;
6452 }
6453 __pyx_t_2 = (__pyx_v_wavelength != Py_None);
6454
6455 __pyx_t_1 = __pyx_t_2;
6456
6457 __pyx_L3_bool_binop_done:;
6458 if (unlikely(!__pyx_t_1)) {
6459 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_mstate_global->__pyx_kp_u_Period_or_wavelength_must_be_set, 0, 0);
6460 __PYX_ERR(0, 67, __pyx_L1_error)
6461 }
6462
6463 }
6464 #else
6465 if ((1)); else __PYX_ERR(0, 67, __pyx_L1_error)
6466 #endif
6467
6468 /* "fenton/Fenton.pyx":68
6469 * # Data input file
6470 * assert period is not None or wavelength is not None, 'Period or wavelength must be set for Fenton wave'
6471 * if period is None and wavelength is not None: # <<<<<<<<<<<<<<
6472 * mode = 'Wavelength'
6473 * if period is not None and wavelength is None:
6474*/
6475 __pyx_t_2 = (__pyx_v_period == Py_None);
6476 if (__pyx_t_2) {
6477
6478 } else {
6479
6480 __pyx_t_1 = __pyx_t_2;
6481
6482 goto __pyx_L6_bool_binop_done;
6483 }
6484 __pyx_t_2 = (__pyx_v_wavelength != Py_None);
6485
6486 __pyx_t_1 = __pyx_t_2;
6487
6488 __pyx_L6_bool_binop_done:;
6489 if (__pyx_t_1) {
6490
6491
6492 /* "fenton/Fenton.pyx":69
6493 * assert period is not None or wavelength is not None, 'Period or wavelength must be set for Fenton wave'
6494 * if period is None and wavelength is not None:
6495 * mode = 'Wavelength' # <<<<<<<<<<<<<<
6496 * if period is not None and wavelength is None:
6497 * mode = 'Period'
6498*/
6499 __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_Wavelength);
6500 __Pyx_DECREF_SET(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_Wavelength);
6501
6502 /* "fenton/Fenton.pyx":68
6503 * # Data input file
6504 * assert period is not None or wavelength is not None, 'Period or wavelength must be set for Fenton wave'
6505 * if period is None and wavelength is not None: # <<<<<<<<<<<<<<
6506 * mode = 'Wavelength'
6507 * if period is not None and wavelength is None:
6508*/
6509 }
6510
6511 /* "fenton/Fenton.pyx":70
6512 * if period is None and wavelength is not None:
6513 * mode = 'Wavelength'
6514 * if period is not None and wavelength is None: # <<<<<<<<<<<<<<
6515 * mode = 'Period'
6516 * filename = 'Data.dat'
6517*/
6518 __pyx_t_2 = (__pyx_v_period != Py_None);
6519 if (__pyx_t_2) {
6520
6521 } else {
6522
6523 __pyx_t_1 = __pyx_t_2;
6524
6525 goto __pyx_L9_bool_binop_done;
6526 }
6527 __pyx_t_2 = (__pyx_v_wavelength == Py_None);
6528
6529 __pyx_t_1 = __pyx_t_2;
6530
6531 __pyx_L9_bool_binop_done:;
6532 if (__pyx_t_1) {
6533
6534
6535 /* "fenton/Fenton.pyx":71
6536 * mode = 'Wavelength'
6537 * if period is not None and wavelength is None:
6538 * mode = 'Period' # <<<<<<<<<<<<<<
6539 * filename = 'Data.dat'
6540 * with open(filename, 'w') as f:
6541*/
6542 __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_Period);
6543 __Pyx_DECREF_SET(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_Period);
6544
6545 /* "fenton/Fenton.pyx":70
6546 * if period is None and wavelength is not None:
6547 * mode = 'Wavelength'
6548 * if period is not None and wavelength is None: # <<<<<<<<<<<<<<
6549 * mode = 'Period'
6550 * filename = 'Data.dat'
6551*/
6552 }
6553
6554 /* "fenton/Fenton.pyx":72
6555 * if period is not None and wavelength is None:
6556 * mode = 'Period'
6557 * filename = 'Data.dat' # <<<<<<<<<<<<<<
6558 * with open(filename, 'w') as f:
6559 * waveheight_dimless = waveheight/depth
6560*/
6561 __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_Data_dat);
6562 __pyx_v_filename = __pyx_mstate_global->__pyx_kp_u_Data_dat;
6563
6564 /* "fenton/Fenton.pyx":73
6565 * mode = 'Period'
6566 * filename = 'Data.dat'
6567 * with open(filename, 'w') as f: # <<<<<<<<<<<<<<
6568 * waveheight_dimless = waveheight/depth
6569 * mode = mode
6570*/
6571 /*with:*/ {
6572 __pyx_t_4 = NULL;
6573 __pyx_t_5 = 1;
6574 {
6575 PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_filename, __pyx_mstate_global->__pyx_n_u_w};
6576 __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_open, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
6577 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6578 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __pyx_L1_error)
6579 __Pyx_GOTREF(__pyx_t_3);
6580 }
6581 __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 73, __pyx_L1_error)
6582 __Pyx_GOTREF(__pyx_t_6);
6583 __pyx_t_7 = NULL;
6584 __pyx_t_8 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 73, __pyx_L11_error)
6585 __Pyx_GOTREF(__pyx_t_8);
6586 __pyx_t_5 = 1;
6587 #if CYTHON_UNPACK_METHODS
6588 if (likely(PyMethod_Check(__pyx_t_8))) {
6589 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
6590 assert(__pyx_t_7);
6591 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
6592 __Pyx_INCREF(__pyx_t_7);
6593 __Pyx_INCREF(__pyx__function);
6594 __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
6595 __pyx_t_5 = 0;
6596 }
6597 #endif
6598 {
6599 PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
6600 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
6601 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6602 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6603 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 73, __pyx_L11_error)
6604 __Pyx_GOTREF(__pyx_t_4);
6605 }
6606 __pyx_t_8 = __pyx_t_4;
6607 __pyx_t_4 = 0;
6608 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6609 /*try:*/ {
6610 {
6611 __Pyx_PyThreadState_declare
6612 __Pyx_PyThreadState_assign
6613 __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
6614 __Pyx_XGOTREF(__pyx_t_9);
6615 __Pyx_XGOTREF(__pyx_t_10);
6616 __Pyx_XGOTREF(__pyx_t_11);
6617 /*try:*/ {
6618 __pyx_v_f = __pyx_t_8;
6619 __pyx_t_8 = 0;
6620
6621 /* "fenton/Fenton.pyx":74
6622 * filename = 'Data.dat'
6623 * with open(filename, 'w') as f:
6624 * waveheight_dimless = waveheight/depth # <<<<<<<<<<<<<<
6625 * mode = mode
6626 * if mode == 'Period':
6627*/
6628 __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_v_waveheight, __pyx_v_depth); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 74, __pyx_L15_error)
6629 __Pyx_GOTREF(__pyx_t_8);
6630 __pyx_v_waveheight_dimless = __pyx_t_8;
6631 __pyx_t_8 = 0;
6632
6633 /* "fenton/Fenton.pyx":75
6634 * with open(filename, 'w') as f:
6635 * waveheight_dimless = waveheight/depth
6636 * mode = mode # <<<<<<<<<<<<<<
6637 * if mode == 'Period':
6638 * length_dimless = period*np.sqrt(g/depth)
6639*/
6640 __Pyx_INCREF(__pyx_v_mode);
6641 __Pyx_DECREF_SET(__pyx_v_mode, __pyx_v_mode);
6642
6643 /* "fenton/Fenton.pyx":76
6644 * waveheight_dimless = waveheight/depth
6645 * mode = mode
6646 * if mode == 'Period': # <<<<<<<<<<<<<<
6647 * length_dimless = period*np.sqrt(g/depth)
6648 * elif mode == 'Wavelength':
6649*/
6650 __pyx_t_1 = __Pyx_PyObject_CompareBoolEq_object_str(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_Period, Py_EQ); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 76, __pyx_L15_error)
6651 if (__pyx_t_1) {
6652
6653
6654 /* "fenton/Fenton.pyx":77
6655 * mode = mode
6656 * if mode == 'Period':
6657 * length_dimless = period*np.sqrt(g/depth) # <<<<<<<<<<<<<<
6658 * elif mode == 'Wavelength':
6659 * length_dimless = wavelength/depth
6660*/
6661 __pyx_t_3 = NULL;
6662 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L15_error)
6663 __Pyx_GOTREF(__pyx_t_4);
6664 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_sqrt); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 77, __pyx_L15_error)
6665 __Pyx_GOTREF(__pyx_t_7);
6666 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6667 __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_v_g, __pyx_v_depth); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L15_error)
6668 __Pyx_GOTREF(__pyx_t_4);
6669 __pyx_t_5 = 1;
6670 #if CYTHON_UNPACK_METHODS
6671 if (unlikely(PyMethod_Check(__pyx_t_7))) {
6672 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
6673 assert(__pyx_t_3);
6674 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
6675 __Pyx_INCREF(__pyx_t_3);
6676 __Pyx_INCREF(__pyx__function);
6677 __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
6678 __pyx_t_5 = 0;
6679 }
6680 #endif
6681 {
6682 PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
6683 __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
6684 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6685 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6686 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6687 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 77, __pyx_L15_error)
6688 __Pyx_GOTREF(__pyx_t_8);
6689 }
6690 __pyx_t_7 = __Pyx_PyNumber_Multiply_object_object(__pyx_v_period, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 77, __pyx_L15_error)
6691 __Pyx_GOTREF(__pyx_t_7);
6692 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6693 __pyx_v_length_dimless = __pyx_t_7;
6694 __pyx_t_7 = 0;
6695
6696 /* "fenton/Fenton.pyx":76
6697 * waveheight_dimless = waveheight/depth
6698 * mode = mode
6699 * if mode == 'Period': # <<<<<<<<<<<<<<
6700 * length_dimless = period*np.sqrt(g/depth)
6701 * elif mode == 'Wavelength':
6702*/
6703 goto __pyx_L21;
6704 }
6705
6706 /* "fenton/Fenton.pyx":78
6707 * if mode == 'Period':
6708 * length_dimless = period*np.sqrt(g/depth)
6709 * elif mode == 'Wavelength': # <<<<<<<<<<<<<<
6710 * length_dimless = wavelength/depth
6711 * current_magnitude_dimless = current_magnitude/np.sqrt(g*depth)
6712*/
6713 __pyx_t_1 = __Pyx_PyObject_CompareBoolEq_object_str(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_Wavelength, Py_EQ); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 78, __pyx_L15_error)
6714 if (__pyx_t_1) {
6715
6716
6717 /* "fenton/Fenton.pyx":79
6718 * length_dimless = period*np.sqrt(g/depth)
6719 * elif mode == 'Wavelength':
6720 * length_dimless = wavelength/depth # <<<<<<<<<<<<<<
6721 * current_magnitude_dimless = current_magnitude/np.sqrt(g*depth)
6722 * f.write('''Wave
6723*/
6724 __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_v_wavelength, __pyx_v_depth); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 79, __pyx_L15_error)
6725 __Pyx_GOTREF(__pyx_t_7);
6726 __pyx_v_length_dimless = __pyx_t_7;
6727 __pyx_t_7 = 0;
6728
6729 /* "fenton/Fenton.pyx":78
6730 * if mode == 'Period':
6731 * length_dimless = period*np.sqrt(g/depth)
6732 * elif mode == 'Wavelength': # <<<<<<<<<<<<<<
6733 * length_dimless = wavelength/depth
6734 * current_magnitude_dimless = current_magnitude/np.sqrt(g*depth)
6735*/
6736 }
6737 __pyx_L21:;
6738
6739 /* "fenton/Fenton.pyx":80
6740 * elif mode == 'Wavelength':
6741 * length_dimless = wavelength/depth
6742 * current_magnitude_dimless = current_magnitude/np.sqrt(g*depth) # <<<<<<<<<<<<<<
6743 * f.write('''Wave
6744 * {waveheight}
6745*/
6746 __pyx_t_8 = NULL;
6747 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 80, __pyx_L15_error)
6748 __Pyx_GOTREF(__pyx_t_4);
6749 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_sqrt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L15_error)
6750 __Pyx_GOTREF(__pyx_t_3);
6751 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6752 __pyx_t_4 = __Pyx_PyNumber_Multiply_object_object(__pyx_v_g, __pyx_v_depth); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 80, __pyx_L15_error)
6753 __Pyx_GOTREF(__pyx_t_4);
6754 __pyx_t_5 = 1;
6755 #if CYTHON_UNPACK_METHODS
6756 if (unlikely(PyMethod_Check(__pyx_t_3))) {
6757 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
6758 assert(__pyx_t_8);
6759 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
6760 __Pyx_INCREF(__pyx_t_8);
6761 __Pyx_INCREF(__pyx__function);
6762 __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
6763 __pyx_t_5 = 0;
6764 }
6765 #endif
6766 {
6767 PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_4};
6768 __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
6769 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6770 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6771 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6772 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 80, __pyx_L15_error)
6773 __Pyx_GOTREF(__pyx_t_7);
6774 }
6775 __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_v_current_magnitude, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L15_error)
6776 __Pyx_GOTREF(__pyx_t_3);
6777 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6778 __pyx_v_current_magnitude_dimless = __pyx_t_3;
6779 __pyx_t_3 = 0;
6780
6781 /* "fenton/Fenton.pyx":81
6782 * length_dimless = wavelength/depth
6783 * current_magnitude_dimless = current_magnitude/np.sqrt(g*depth)
6784 * f.write('''Wave # <<<<<<<<<<<<<<
6785 * {waveheight}
6786 * {mode}
6787*/
6788 __pyx_t_7 = __pyx_v_f;
6789 __Pyx_INCREF(__pyx_t_7);
6790
6791 /* "fenton/Fenton.pyx":89
6792 * {ncoeffs}
6793 * {height_steps}
6794 * '''.format(waveheight=waveheight_dimless, mode=mode, length=length_dimless, current_criterion=current_criterion, # <<<<<<<<<<<<<<
6795 * current_magnitude=current_magnitude_dimless, ncoeffs=ncoeffs, height_steps=height_steps))
6796 * # Convergence options file
6797*/
6798 __pyx_t_8 = __pyx_mstate_global->__pyx_kp_u_Wave_waveheight_mode_length_curr;
6799 __Pyx_INCREF(__pyx_t_8);
6800 if (unlikely(!__pyx_v_length_dimless)) { __Pyx_RaiseUnboundLocalError("length_dimless"); __PYX_ERR(0, 89, __pyx_L15_error) }
6801
6802 /* "fenton/Fenton.pyx":90
6803 * {height_steps}
6804 * '''.format(waveheight=waveheight_dimless, mode=mode, length=length_dimless, current_criterion=current_criterion,
6805 * current_magnitude=current_magnitude_dimless, ncoeffs=ncoeffs, height_steps=height_steps)) # <<<<<<<<<<<<<<
6806 * # Convergence options file
6807 * filename = 'Convergence.dat'
6808*/
6809 __pyx_t_5 = 0;
6810 {
6811 PyObject *__pyx_callargs[8] = {__pyx_t_8, __pyx_v_waveheight_dimless, __pyx_v_mode, __pyx_v_length_dimless, __pyx_v_current_criterion, __pyx_v_current_magnitude_dimless, __pyx_v_ncoeffs, __pyx_v_height_steps};
6812 #if CYTHON_VECTORCALL
6813 __pyx_t_12 = __pyx_mstate_global->__pyx_tuple[0];
6814 if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 89, __pyx_L15_error)
6815 __Pyx_INCREF(__pyx_t_12);
6816 #else
6817 {
6818 PyObject *__pyx_temp[7] = {__pyx_mstate_global->__pyx_n_u_waveheight, __pyx_mstate_global->__pyx_n_u_mode, __pyx_mstate_global->__pyx_n_u_length, __pyx_mstate_global->__pyx_n_u_current_criterion, __pyx_mstate_global->__pyx_n_u_current_magnitude, __pyx_mstate_global->__pyx_n_u_ncoeffs, __pyx_mstate_global->__pyx_n_u_height_steps};
6819 __pyx_t_12 = __Pyx_MakeKwargDict(__pyx_temp, __pyx_callargs+1, 7);
6820 if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 89, __pyx_L15_error)
6821 __Pyx_GOTREF(__pyx_t_12);
6822 }
6823 #endif
6824 __pyx_t_4 = __Pyx_Object_VectorcallMethodKwds((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_12);
6825 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6826 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
6827 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 89, __pyx_L15_error)
6828 __Pyx_GOTREF(__pyx_t_4);
6829 }
6830
6831 /* "fenton/Fenton.pyx":89
6832 * {ncoeffs}
6833 * {height_steps}
6834 * '''.format(waveheight=waveheight_dimless, mode=mode, length=length_dimless, current_criterion=current_criterion, # <<<<<<<<<<<<<<
6835 * current_magnitude=current_magnitude_dimless, ncoeffs=ncoeffs, height_steps=height_steps))
6836 * # Convergence options file
6837*/
6838 if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_4))) __PYX_ERR(0, 89, __pyx_L15_error)
6839 __pyx_t_5 = 0;
6840 {
6841 PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_4};
6842 __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
6843 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6844 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6845 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __pyx_L15_error)
6846 __Pyx_GOTREF(__pyx_t_3);
6847 }
6848 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6849
6850 /* "fenton/Fenton.pyx":73
6851 * mode = 'Period'
6852 * filename = 'Data.dat'
6853 * with open(filename, 'w') as f: # <<<<<<<<<<<<<<
6854 * waveheight_dimless = waveheight/depth
6855 * mode = mode
6856*/
6857 }
6858 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
6859 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
6860 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
6861 goto __pyx_L20_try_end;
6862 __pyx_L15_error:;
6863 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
6864 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6865 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6866 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6867 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6868 /*except:*/ {
6869 __Pyx_AddTraceback("fenton.Fenton.writeInput", __pyx_clineno, __pyx_lineno, __pyx_filename);
6870 if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(0, 73, __pyx_L17_except_error)
6871 __Pyx_XGOTREF(__pyx_t_3);
6872 __Pyx_XGOTREF(__pyx_t_4);
6873 __Pyx_XGOTREF(__pyx_t_7);
6874 {
6875 PyObject* __pyx_temp[3] = {__pyx_t_3, __pyx_t_4, __pyx_t_7};
6876 __pyx_t_12 = __Pyx_PyTuple_FromArray(__pyx_temp, 3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 73, __pyx_L17_except_error)
6877 __Pyx_GOTREF(__pyx_t_12);
6878 }
6879 __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_12, NULL);
6880 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6881 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
6882 if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 73, __pyx_L17_except_error)
6883 __Pyx_GOTREF(__pyx_t_13);
6884 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_13);
6885 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
6886 if (__pyx_t_1 < (0)) __PYX_ERR(0, 73, __pyx_L17_except_error)
6887 __pyx_t_2 = (!__pyx_t_1);
6888
6889
6890 if (unlikely(__pyx_t_2)) {
6891
6892 __Pyx_GIVEREF(__pyx_t_3);
6893 __Pyx_GIVEREF(__pyx_t_4);
6894 __Pyx_XGIVEREF(__pyx_t_7);
6895 __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_4, __pyx_t_7);
6896 __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_7 = 0;
6897 __PYX_ERR(0, 73, __pyx_L17_except_error)
6898 }
6899 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6900 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6901 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6902 goto __pyx_L16_exception_handled;
6903 }
6904 __pyx_L17_except_error:;
6905 __Pyx_XGIVEREF(__pyx_t_9);
6906 __Pyx_XGIVEREF(__pyx_t_10);
6907 __Pyx_XGIVEREF(__pyx_t_11);
6908 __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
6909 goto __pyx_L1_error;
6910 __pyx_L16_exception_handled:;
6911 __Pyx_XGIVEREF(__pyx_t_9);
6912 __Pyx_XGIVEREF(__pyx_t_10);
6913 __Pyx_XGIVEREF(__pyx_t_11);
6914 __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
6915 __pyx_L20_try_end:;
6916 }
6917 }
6918 /*finally:*/ {
6919 /*normal exit:*/{
6920 if (__pyx_t_6) {
6921 __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[1], NULL);
6922 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6923 if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 73, __pyx_L1_error)
6924 __Pyx_GOTREF(__pyx_t_11);
6925 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
6926 }
6927 goto __pyx_L14;
6928 }
6929 __pyx_L14:;
6930 }
6931 goto __pyx_L25;
6932 __pyx_L11_error:;
6933 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6934 goto __pyx_L1_error;
6935 __pyx_L25:;
6936 }
6937
6938 /* "fenton/Fenton.pyx":92
6939 * current_magnitude=current_magnitude_dimless, ncoeffs=ncoeffs, height_steps=height_steps))
6940 * # Convergence options file
6941 * filename = 'Convergence.dat' # <<<<<<<<<<<<<<
6942 * with open(filename, 'w') as f:
6943 * f.write('''Control file to control convergence and output of results
6944*/
6945 __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_Convergence_dat);
6946 __Pyx_DECREF_SET(__pyx_v_filename, __pyx_mstate_global->__pyx_kp_u_Convergence_dat);
6947
6948 /* "fenton/Fenton.pyx":93
6949 * # Convergence options file
6950 * filename = 'Convergence.dat'
6951 * with open(filename, 'w') as f: # <<<<<<<<<<<<<<
6952 * f.write('''Control file to control convergence and output of results
6953 * {niter} Maximum number of iterations for each height step; 10 OK for ordinary waves, 40 for highest
6954*/
6955 /*with:*/ {
6956 __pyx_t_4 = NULL;
6957 __pyx_t_5 = 1;
6958 {
6959 PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_filename, __pyx_mstate_global->__pyx_n_u_w};
6960 __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_open, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
6961 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6962 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 93, __pyx_L1_error)
6963 __Pyx_GOTREF(__pyx_t_7);
6964 }
6965 __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 93, __pyx_L1_error)
6966 __Pyx_GOTREF(__pyx_t_6);
6967 __pyx_t_3 = NULL;
6968 __pyx_t_12 = __Pyx_PyObject_LookupSpecial(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 93, __pyx_L26_error)
6969 __Pyx_GOTREF(__pyx_t_12);
6970 __pyx_t_5 = 1;
6971 #if CYTHON_UNPACK_METHODS
6972 if (likely(PyMethod_Check(__pyx_t_12))) {
6973 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_12);
6974 assert(__pyx_t_3);
6975 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12);
6976 __Pyx_INCREF(__pyx_t_3);
6977 __Pyx_INCREF(__pyx__function);
6978 __Pyx_DECREF_SET(__pyx_t_12, __pyx__function);
6979 __pyx_t_5 = 0;
6980 }
6981 #endif
6982 {
6983 PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
6984 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
6985 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6986 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
6987 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 93, __pyx_L26_error)
6988 __Pyx_GOTREF(__pyx_t_4);
6989 }
6990 __pyx_t_12 = __pyx_t_4;
6991 __pyx_t_4 = 0;
6992 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6993 /*try:*/ {
6994 {
6995 __Pyx_PyThreadState_declare
6996 __Pyx_PyThreadState_assign
6997 __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
6998 __Pyx_XGOTREF(__pyx_t_11);
6999 __Pyx_XGOTREF(__pyx_t_10);
7000 __Pyx_XGOTREF(__pyx_t_9);
7001 /*try:*/ {
7002 __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_12);
7003 __pyx_t_12 = 0;
7004
7005 /* "fenton/Fenton.pyx":94
7006 * filename = 'Convergence.dat'
7007 * with open(filename, 'w') as f:
7008 * f.write('''Control file to control convergence and output of results # <<<<<<<<<<<<<<
7009 * {niter} Maximum number of iterations for each height step; 10 OK for ordinary waves, 40 for highest
7010 * {conv_crit} Criterion for convergence, typically 1.e-4, or 1.e-5 for highest waves
7011*/
7012 __pyx_t_7 = __pyx_v_f;
7013 __Pyx_INCREF(__pyx_t_7);
7014
7015 /* "fenton/Fenton.pyx":97
7016 * {niter} Maximum number of iterations for each height step; 10 OK for ordinary waves, 40 for highest
7017 * {conv_crit} Criterion for convergence, typically 1.e-4, or 1.e-5 for highest waves
7018 * '''.format(niter=niter, conv_crit=conv_crit)) # <<<<<<<<<<<<<<
7019 * # Points number file
7020 * filename = 'Points.dat'
7021*/
7022 __pyx_t_3 = __pyx_mstate_global->__pyx_kp_u_Control_file_to_control_converge;
7023 __Pyx_INCREF(__pyx_t_3);
7024 __pyx_t_5 = 0;
7025 {
7026 PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_niter, __pyx_v_conv_crit};
7027 #if CYTHON_VECTORCALL
7028 __pyx_t_8 = __pyx_mstate_global->__pyx_tuple[2];
7029 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 97, __pyx_L30_error)
7030 __Pyx_INCREF(__pyx_t_8);
7031 #else
7032 {
7033 PyObject *__pyx_temp[2] = {__pyx_mstate_global->__pyx_n_u_niter, __pyx_mstate_global->__pyx_n_u_conv_crit};
7034 __pyx_t_8 = __Pyx_MakeKwargDict(__pyx_temp, __pyx_callargs+1, 2);
7035 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 97, __pyx_L30_error)
7036 __Pyx_GOTREF(__pyx_t_8);
7037 }
7038 #endif
7039 __pyx_t_4 = __Pyx_Object_VectorcallMethodKwds((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_8);
7040 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7041 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7042 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L30_error)
7043 __Pyx_GOTREF(__pyx_t_4);
7044 }
7045 if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_4))) __PYX_ERR(0, 97, __pyx_L30_error)
7046 __pyx_t_5 = 0;
7047 {
7048 PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_4};
7049 __pyx_t_12 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
7050 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
7051 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7052 if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 94, __pyx_L30_error)
7053 __Pyx_GOTREF(__pyx_t_12);
7054 }
7055 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7056
7057 /* "fenton/Fenton.pyx":93
7058 * # Convergence options file
7059 * filename = 'Convergence.dat'
7060 * with open(filename, 'w') as f: # <<<<<<<<<<<<<<
7061 * f.write('''Control file to control convergence and output of results
7062 * {niter} Maximum number of iterations for each height step; 10 OK for ordinary waves, 40 for highest
7063*/
7064 }
7065 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
7066 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
7067 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
7068 goto __pyx_L35_try_end;
7069 __pyx_L30_error:;
7070 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
7071 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7072 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7073 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
7074 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
7075 /*except:*/ {
7076 __Pyx_AddTraceback("fenton.Fenton.writeInput", __pyx_clineno, __pyx_lineno, __pyx_filename);
7077 if (__Pyx_GetException(&__pyx_t_12, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(0, 93, __pyx_L32_except_error)
7078 __Pyx_XGOTREF(__pyx_t_12);
7079 __Pyx_XGOTREF(__pyx_t_4);
7080 __Pyx_XGOTREF(__pyx_t_7);
7081 {
7082 PyObject* __pyx_temp[3] = {__pyx_t_12, __pyx_t_4, __pyx_t_7};
7083 __pyx_t_8 = __Pyx_PyTuple_FromArray(__pyx_temp, 3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 93, __pyx_L32_except_error)
7084 __Pyx_GOTREF(__pyx_t_8);
7085 }
7086 __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL);
7087 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7088 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7089 if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 93, __pyx_L32_except_error)
7090 __Pyx_GOTREF(__pyx_t_13);
7091 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13);
7092 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7093 if (__pyx_t_2 < (0)) __PYX_ERR(0, 93, __pyx_L32_except_error)
7094 __pyx_t_1 = (!__pyx_t_2);
7095
7096
7097 if (unlikely(__pyx_t_1)) {
7098
7099 __Pyx_GIVEREF(__pyx_t_12);
7100 __Pyx_GIVEREF(__pyx_t_4);
7101 __Pyx_XGIVEREF(__pyx_t_7);
7102 __Pyx_ErrRestoreWithState(__pyx_t_12, __pyx_t_4, __pyx_t_7);
7103 __pyx_t_12 = 0; __pyx_t_4 = 0; __pyx_t_7 = 0;
7104 __PYX_ERR(0, 93, __pyx_L32_except_error)
7105 }
7106 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
7107 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7108 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
7109 goto __pyx_L31_exception_handled;
7110 }
7111 __pyx_L32_except_error:;
7112 __Pyx_XGIVEREF(__pyx_t_11);
7113 __Pyx_XGIVEREF(__pyx_t_10);
7114 __Pyx_XGIVEREF(__pyx_t_9);
7115 __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
7116 goto __pyx_L1_error;
7117 __pyx_L31_exception_handled:;
7118 __Pyx_XGIVEREF(__pyx_t_11);
7119 __Pyx_XGIVEREF(__pyx_t_10);
7120 __Pyx_XGIVEREF(__pyx_t_9);
7121 __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
7122 __pyx_L35_try_end:;
7123 }
7124 }
7125 /*finally:*/ {
7126 /*normal exit:*/{
7127 if (__pyx_t_6) {
7128 __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[1], NULL);
7129 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7130 if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 93, __pyx_L1_error)
7131 __Pyx_GOTREF(__pyx_t_9);
7132 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7133 }
7134 goto __pyx_L29;
7135 }
7136 __pyx_L29:;
7137 }
7138 goto __pyx_L39;
7139 __pyx_L26_error:;
7140 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7141 goto __pyx_L1_error;
7142 __pyx_L39:;
7143 }
7144
7145 /* "fenton/Fenton.pyx":99
7146 * '''.format(niter=niter, conv_crit=conv_crit))
7147 * # Points number file
7148 * filename = 'Points.dat' # <<<<<<<<<<<<<<
7149 * with open(filename, 'w') as f:
7150 * f.write('''Control file to control convergence and output of results
7151*/
7152 __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_Points_dat);
7153 __Pyx_DECREF_SET(__pyx_v_filename, __pyx_mstate_global->__pyx_kp_u_Points_dat);
7154
7155 /* "fenton/Fenton.pyx":100
7156 * # Points number file
7157 * filename = 'Points.dat'
7158 * with open(filename, 'w') as f: # <<<<<<<<<<<<<<
7159 * f.write('''Control file to control convergence and output of results
7160 * {niter} Maximum number of iterations for each height step; 10 OK for ordinary waves, 40 for highest
7161*/
7162 /*with:*/ {
7163 __pyx_t_4 = NULL;
7164 __pyx_t_5 = 1;
7165 {
7166 PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_filename, __pyx_mstate_global->__pyx_n_u_w};
7167 __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_open, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
7168 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7169 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 100, __pyx_L1_error)
7170 __Pyx_GOTREF(__pyx_t_7);
7171 }
7172 __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 100, __pyx_L1_error)
7173 __Pyx_GOTREF(__pyx_t_6);
7174 __pyx_t_12 = NULL;
7175 __pyx_t_8 = __Pyx_PyObject_LookupSpecial(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 100, __pyx_L40_error)
7176 __Pyx_GOTREF(__pyx_t_8);
7177 __pyx_t_5 = 1;
7178 #if CYTHON_UNPACK_METHODS
7179 if (likely(PyMethod_Check(__pyx_t_8))) {
7180 __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_8);
7181 assert(__pyx_t_12);
7182 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
7183 __Pyx_INCREF(__pyx_t_12);
7184 __Pyx_INCREF(__pyx__function);
7185 __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
7186 __pyx_t_5 = 0;
7187 }
7188 #endif
7189 {
7190 PyObject *__pyx_callargs[2] = {__pyx_t_12, NULL};
7191 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
7192 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
7193 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7194 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 100, __pyx_L40_error)
7195 __Pyx_GOTREF(__pyx_t_4);
7196 }
7197 __pyx_t_8 = __pyx_t_4;
7198 __pyx_t_4 = 0;
7199 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7200 /*try:*/ {
7201 {
7202 __Pyx_PyThreadState_declare
7203 __Pyx_PyThreadState_assign
7204 __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
7205 __Pyx_XGOTREF(__pyx_t_9);
7206 __Pyx_XGOTREF(__pyx_t_10);
7207 __Pyx_XGOTREF(__pyx_t_11);
7208 /*try:*/ {
7209 __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_8);
7210 __pyx_t_8 = 0;
7211
7212 /* "fenton/Fenton.pyx":101
7213 * filename = 'Points.dat'
7214 * with open(filename, 'w') as f:
7215 * f.write('''Control file to control convergence and output of results # <<<<<<<<<<<<<<
7216 * {niter} Maximum number of iterations for each height step; 10 OK for ordinary waves, 40 for highest
7217 * {conv_crit} Criterion for convergence, typically 1.e-4, or 1.e-5 for highest waves
7218*/
7219 __pyx_t_7 = __pyx_v_f;
7220 __Pyx_INCREF(__pyx_t_7);
7221
7222 /* "fenton/Fenton.pyx":104
7223 * {niter} Maximum number of iterations for each height step; 10 OK for ordinary waves, 40 for highest
7224 * {conv_crit} Criterion for convergence, typically 1.e-4, or 1.e-5 for highest waves
7225 * '''.format(niter=niter, conv_crit=conv_crit)) # <<<<<<<<<<<<<<
7226 *
7227 * def runFourier():
7228*/
7229 __pyx_t_12 = __pyx_mstate_global->__pyx_kp_u_Control_file_to_control_converge;
7230 __Pyx_INCREF(__pyx_t_12);
7231 __pyx_t_5 = 0;
7232 {
7233 PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_v_niter, __pyx_v_conv_crit};
7234 #if CYTHON_VECTORCALL
7235 __pyx_t_3 = __pyx_mstate_global->__pyx_tuple[2];
7236 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L44_error)
7237 __Pyx_INCREF(__pyx_t_3);
7238 #else
7239 {
7240 PyObject *__pyx_temp[2] = {__pyx_mstate_global->__pyx_n_u_niter, __pyx_mstate_global->__pyx_n_u_conv_crit};
7241 __pyx_t_3 = __Pyx_MakeKwargDict(__pyx_temp, __pyx_callargs+1, 2);
7242 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L44_error)
7243 __Pyx_GOTREF(__pyx_t_3);
7244 }
7245 #endif
7246 __pyx_t_4 = __Pyx_Object_VectorcallMethodKwds((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
7247 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
7248 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7249 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L44_error)
7250 __Pyx_GOTREF(__pyx_t_4);
7251 }
7252 if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_4))) __PYX_ERR(0, 104, __pyx_L44_error)
7253 __pyx_t_5 = 0;
7254 {
7255 PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_4};
7256 __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
7257 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
7258 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7259 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 101, __pyx_L44_error)
7260 __Pyx_GOTREF(__pyx_t_8);
7261 }
7262 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7263
7264 /* "fenton/Fenton.pyx":100
7265 * # Points number file
7266 * filename = 'Points.dat'
7267 * with open(filename, 'w') as f: # <<<<<<<<<<<<<<
7268 * f.write('''Control file to control convergence and output of results
7269 * {niter} Maximum number of iterations for each height step; 10 OK for ordinary waves, 40 for highest
7270*/
7271 }
7272 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
7273 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
7274 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
7275 goto __pyx_L49_try_end;
7276 __pyx_L44_error:;
7277 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
7278 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7279 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7280 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
7281 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
7282 /*except:*/ {
7283 __Pyx_AddTraceback("fenton.Fenton.writeInput", __pyx_clineno, __pyx_lineno, __pyx_filename);
7284 if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(0, 100, __pyx_L46_except_error)
7285 __Pyx_XGOTREF(__pyx_t_8);
7286 __Pyx_XGOTREF(__pyx_t_4);
7287 __Pyx_XGOTREF(__pyx_t_7);
7288 {
7289 PyObject* __pyx_temp[3] = {__pyx_t_8, __pyx_t_4, __pyx_t_7};
7290 __pyx_t_3 = __Pyx_PyTuple_FromArray(__pyx_temp, 3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L46_except_error)
7291 __Pyx_GOTREF(__pyx_t_3);
7292 }
7293 __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL);
7294 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7295 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7296 if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 100, __pyx_L46_except_error)
7297 __Pyx_GOTREF(__pyx_t_13);
7298 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_13);
7299 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7300 if (__pyx_t_1 < (0)) __PYX_ERR(0, 100, __pyx_L46_except_error)
7301 __pyx_t_2 = (!__pyx_t_1);
7302
7303
7304 if (unlikely(__pyx_t_2)) {
7305
7306 __Pyx_GIVEREF(__pyx_t_8);
7307 __Pyx_GIVEREF(__pyx_t_4);
7308 __Pyx_XGIVEREF(__pyx_t_7);
7309 __Pyx_ErrRestoreWithState(__pyx_t_8, __pyx_t_4, __pyx_t_7);
7310 __pyx_t_8 = 0; __pyx_t_4 = 0; __pyx_t_7 = 0;
7311 __PYX_ERR(0, 100, __pyx_L46_except_error)
7312 }
7313 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
7314 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7315 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
7316 goto __pyx_L45_exception_handled;
7317 }
7318 __pyx_L46_except_error:;
7319 __Pyx_XGIVEREF(__pyx_t_9);
7320 __Pyx_XGIVEREF(__pyx_t_10);
7321 __Pyx_XGIVEREF(__pyx_t_11);
7322 __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
7323 goto __pyx_L1_error;
7324 __pyx_L45_exception_handled:;
7325 __Pyx_XGIVEREF(__pyx_t_9);
7326 __Pyx_XGIVEREF(__pyx_t_10);
7327 __Pyx_XGIVEREF(__pyx_t_11);
7328 __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
7329 __pyx_L49_try_end:;
7330 }
7331 }
7332 /*finally:*/ {
7333 /*normal exit:*/{
7334 if (__pyx_t_6) {
7335 __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[1], NULL);
7336 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7337 if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 100, __pyx_L1_error)
7338 __Pyx_GOTREF(__pyx_t_11);
7339 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7340 }
7341 goto __pyx_L43;
7342 }
7343 __pyx_L43:;
7344 }
7345 goto __pyx_L53;
7346 __pyx_L40_error:;
7347 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7348 goto __pyx_L1_error;
7349 __pyx_L53:;
7350 }
7351
7352 /* "fenton/Fenton.pyx":17
7353 * cdef void runfourier()
7354 *
7355 * def writeInput(waveheight, # <<<<<<<<<<<<<<
7356 * depth,
7357 * period=None,
7358*/
7359
7360 /* function exit code */
7361 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7362 goto __pyx_L0;
7363 __pyx_L1_error:;
7364 __Pyx_XDECREF(__pyx_t_3);
7365 __Pyx_XDECREF(__pyx_t_4);
7366 __Pyx_XDECREF(__pyx_t_7);
7367 __Pyx_XDECREF(__pyx_t_8);
7368 __Pyx_XDECREF(__pyx_t_12);
7369 __Pyx_AddTraceback("fenton.Fenton.writeInput", __pyx_clineno, __pyx_lineno, __pyx_filename);
7370 __pyx_r = NULL;
7371 __pyx_L0:;
7372 __Pyx_XDECREF(__pyx_v_filename);
7373 __Pyx_XDECREF(__pyx_v_f);
7374 __Pyx_XDECREF(__pyx_v_waveheight_dimless);
7375 __Pyx_XDECREF(__pyx_v_length_dimless);
7376 __Pyx_XDECREF(__pyx_v_current_magnitude_dimless);
7377 __Pyx_XDECREF(__pyx_v_mode);
7378 __Pyx_XGIVEREF(__pyx_r);
7379 __Pyx_RefNannyFinishContext();
7380 return __pyx_r;
7381}
7382
7383/* "fenton/Fenton.pyx":106
7384 * '''.format(niter=niter, conv_crit=conv_crit))
7385 *
7386 * def runFourier(): # <<<<<<<<<<<<<<
7387 * '''
7388 * Runs Fourier.cpp script to get Fenton wave solution
7389*/
7390
7391/* Python wrapper */
7392static PyObject *__pyx_pw_6fenton_6Fenton_3runFourier(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
7393PyDoc_STRVAR(__pyx_doc_6fenton_6Fenton_2runFourier, "\n Runs Fourier.cpp script to get Fenton wave solution\n (!) must be called after writeInput(...)\n ");
7394static PyMethodDef __pyx_mdef_6fenton_6Fenton_3runFourier = {"runFourier", (PyCFunction)__pyx_pw_6fenton_6Fenton_3runFourier, METH_NOARGS, __pyx_doc_6fenton_6Fenton_2runFourier};
7395static PyObject *__pyx_pw_6fenton_6Fenton_3runFourier(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
7396 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7397 PyObject *__pyx_r = 0;
7398 __Pyx_RefNannyDeclarations
7399 __Pyx_RefNannySetupContext("runFourier (wrapper)", 0);
7400 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
7401 __pyx_r = __pyx_pf_6fenton_6Fenton_2runFourier(__pyx_self);
7402
7403 /* function exit code */
7404 __Pyx_RefNannyFinishContext();
7405 return __pyx_r;
7406}
7407
7408static PyObject *__pyx_pf_6fenton_6Fenton_2runFourier(CYTHON_UNUSED PyObject *__pyx_self) {
7409 PyObject *__pyx_r = NULL;
7410 __Pyx_RefNannyDeclarations
7411 __Pyx_RefNannySetupContext("runFourier", 0);
7412
7413 /* "fenton/Fenton.pyx":111
7414 * (!) must be called after writeInput(...)
7415 * '''
7416 * runfourier() # <<<<<<<<<<<<<<
7417 *
7418 * def getBYCoeffs():
7419*/
7420 runfourier();
7421
7422 /* "fenton/Fenton.pyx":106
7423 * '''.format(niter=niter, conv_crit=conv_crit))
7424 *
7425 * def runFourier(): # <<<<<<<<<<<<<<
7426 * '''
7427 * Runs Fourier.cpp script to get Fenton wave solution
7428*/
7429
7430 /* function exit code */
7431 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7432 __Pyx_XGIVEREF(__pyx_r);
7433 __Pyx_RefNannyFinishContext();
7434 return __pyx_r;
7435}
7436
7437/* "fenton/Fenton.pyx":113
7438 * runfourier()
7439 *
7440 * def getBYCoeffs(): # <<<<<<<<<<<<<<
7441 * '''
7442 * Get B and Y coeffs of solution
7443*/
7444
7445/* Python wrapper */
7446static PyObject *__pyx_pw_6fenton_6Fenton_5getBYCoeffs(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
7447PyDoc_STRVAR(__pyx_doc_6fenton_6Fenton_4getBYCoeffs, "\n Get B and Y coeffs of solution\n (!) must be called after runFourier()\n\n Returns\n -------\n BCoeffs: array_like\n B coeffs of solution\n YCoeffs: array_like\n Y coeffs of solution\n ");
7448static PyMethodDef __pyx_mdef_6fenton_6Fenton_5getBYCoeffs = {"getBYCoeffs", (PyCFunction)__pyx_pw_6fenton_6Fenton_5getBYCoeffs, METH_NOARGS, __pyx_doc_6fenton_6Fenton_4getBYCoeffs};
7449static PyObject *__pyx_pw_6fenton_6Fenton_5getBYCoeffs(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
7450 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7451 PyObject *__pyx_r = 0;
7452 __Pyx_RefNannyDeclarations
7453 __Pyx_RefNannySetupContext("getBYCoeffs (wrapper)", 0);
7454 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
7455 __pyx_r = __pyx_pf_6fenton_6Fenton_4getBYCoeffs(__pyx_self);
7456
7457 /* function exit code */
7458 __Pyx_RefNannyFinishContext();
7459 return __pyx_r;
7460}
7461
7462static PyObject *__pyx_pf_6fenton_6Fenton_4getBYCoeffs(CYTHON_UNUSED PyObject *__pyx_self) {
7463 PyObject *__pyx_v_FFT = NULL;
7464 PyObject *__pyx_v_BCoeffs = NULL;
7465 PyObject *__pyx_v_YCoeffs = NULL;
7466 PyObject *__pyx_r = NULL;
7467 __Pyx_RefNannyDeclarations
7468 PyObject *__pyx_t_1 = NULL;
7469 PyObject *__pyx_t_2 = NULL;
7470 PyObject *__pyx_t_3 = NULL;
7471 PyObject *__pyx_t_4 = NULL;
7472 size_t __pyx_t_5;
7473 int __pyx_lineno = 0;
7474 const char *__pyx_filename = NULL;
7475 int __pyx_clineno = 0;
7476 __Pyx_RefNannySetupContext("getBYCoeffs", 0);
7477
7478 /* "fenton/Fenton.pyx":125
7479 * Y coeffs of solution
7480 * '''
7481 * FFT = np.genfromtxt('Solution.res', delimiter=None, comments='#') # <<<<<<<<<<<<<<
7482 * BCoeffs = FFT[:,1]
7483 * YCoeffs = FFT[:,2]
7484*/
7485 __pyx_t_2 = NULL;
7486 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error)
7487 __Pyx_GOTREF(__pyx_t_3);
7488 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_genfromtxt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error)
7489 __Pyx_GOTREF(__pyx_t_4);
7490 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7491 __pyx_t_5 = 1;
7492 #if CYTHON_UNPACK_METHODS
7493 if (unlikely(PyMethod_Check(__pyx_t_4))) {
7494 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
7495 assert(__pyx_t_2);
7496 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
7497 __Pyx_INCREF(__pyx_t_2);
7498 __Pyx_INCREF(__pyx__function);
7499 __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
7500 __pyx_t_5 = 0;
7501 }
7502 #endif
7503 {
7504 PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Solution_res, Py_None, __pyx_mstate_global->__pyx_kp_u__2};
7505 #if CYTHON_VECTORCALL
7506 __pyx_t_3 = __pyx_mstate_global->__pyx_tuple[3];
7507 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error)
7508 __Pyx_INCREF(__pyx_t_3);
7509 #else
7510 {
7511 PyObject *__pyx_temp[2] = {__pyx_mstate_global->__pyx_n_u_delimiter, __pyx_mstate_global->__pyx_n_u_comments};
7512 __pyx_t_3 = __Pyx_MakeKwargDict(__pyx_temp, __pyx_callargs+2, 2);
7513 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error)
7514 __Pyx_GOTREF(__pyx_t_3);
7515 }
7516 #endif
7517 __pyx_t_1 = __Pyx_Object_VectorcallKwds((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
7518 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7519 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7520 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7521 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error)
7522 __Pyx_GOTREF(__pyx_t_1);
7523 }
7524 __pyx_v_FFT = __pyx_t_1;
7525 __pyx_t_1 = 0;
7526
7527 /* "fenton/Fenton.pyx":126
7528 * '''
7529 * FFT = np.genfromtxt('Solution.res', delimiter=None, comments='#')
7530 * BCoeffs = FFT[:,1] # <<<<<<<<<<<<<<
7531 * YCoeffs = FFT[:,2]
7532 * return BCoeffs, YCoeffs
7533*/
7534 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_FFT, __pyx_mstate_global->__pyx_tuple[4]); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
7535 __Pyx_GOTREF(__pyx_t_1);
7536 __pyx_v_BCoeffs = __pyx_t_1;
7537 __pyx_t_1 = 0;
7538
7539 /* "fenton/Fenton.pyx":127
7540 * FFT = np.genfromtxt('Solution.res', delimiter=None, comments='#')
7541 * BCoeffs = FFT[:,1]
7542 * YCoeffs = FFT[:,2] # <<<<<<<<<<<<<<
7543 * return BCoeffs, YCoeffs
7544 *
7545*/
7546 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_FFT, __pyx_mstate_global->__pyx_tuple[5]); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error)
7547 __Pyx_GOTREF(__pyx_t_1);
7548 __pyx_v_YCoeffs = __pyx_t_1;
7549 __pyx_t_1 = 0;
7550
7551 /* "fenton/Fenton.pyx":128
7552 * BCoeffs = FFT[:,1]
7553 * YCoeffs = FFT[:,2]
7554 * return BCoeffs, YCoeffs # <<<<<<<<<<<<<<
7555 *
7556 * def getWavelength():
7557*/
7558 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error)
7559 __Pyx_GOTREF(__pyx_t_1);
7560 __Pyx_INCREF(__pyx_v_BCoeffs);
7561 __Pyx_GIVEREF(__pyx_v_BCoeffs);
7562 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_BCoeffs) != (0)) __PYX_ERR(0, 128, __pyx_L1_error);
7563 __Pyx_INCREF(__pyx_v_YCoeffs);
7564 __Pyx_GIVEREF(__pyx_v_YCoeffs);
7565 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_YCoeffs) != (0)) __PYX_ERR(0, 128, __pyx_L1_error);
7566 {
7567 PyObject *__pyx_temp;
7568 {
7569 __pyx_temp = __pyx_r;
7570 __pyx_r = __pyx_t_1;
7571 }
7572 __Pyx_XDECREF(__pyx_temp);
7573 }
7574 __pyx_t_1 = 0;
7575 goto __pyx_L0;
7576
7577 /* "fenton/Fenton.pyx":113
7578 * runfourier()
7579 *
7580 * def getBYCoeffs(): # <<<<<<<<<<<<<<
7581 * '''
7582 * Get B and Y coeffs of solution
7583*/
7584
7585 /* function exit code */
7586 __pyx_L1_error:;
7587 __Pyx_XDECREF(__pyx_t_1);
7588 __Pyx_XDECREF(__pyx_t_2);
7589 __Pyx_XDECREF(__pyx_t_3);
7590 __Pyx_XDECREF(__pyx_t_4);
7591 __Pyx_AddTraceback("fenton.Fenton.getBYCoeffs", __pyx_clineno, __pyx_lineno, __pyx_filename);
7592 __pyx_r = NULL;
7593 __pyx_L0:;
7594 __Pyx_XDECREF(__pyx_v_FFT);
7595 __Pyx_XDECREF(__pyx_v_BCoeffs);
7596 __Pyx_XDECREF(__pyx_v_YCoeffs);
7597 __Pyx_XGIVEREF(__pyx_r);
7598 __Pyx_RefNannyFinishContext();
7599 return __pyx_r;
7600}
7601
7602/* "fenton/Fenton.pyx":130
7603 * return BCoeffs, YCoeffs
7604 *
7605 * def getWavelength(): # <<<<<<<<<<<<<<
7606 * '''
7607 * Get wavelength/depth (dimensionless)
7608*/
7609
7610/* Python wrapper */
7611static PyObject *__pyx_pw_6fenton_6Fenton_7getWavelength(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
7612PyDoc_STRVAR(__pyx_doc_6fenton_6Fenton_6getWavelength, "\n Get wavelength/depth (dimensionless)\n (!) must be called after runFourier()\n\n Parameters\n ----------\n depth: double\n water depth used to compute solution\n\n Returns\n -------\n wavelength: double\n wavelength\n ");
7613static PyMethodDef __pyx_mdef_6fenton_6Fenton_7getWavelength = {"getWavelength", (PyCFunction)__pyx_pw_6fenton_6Fenton_7getWavelength, METH_NOARGS, __pyx_doc_6fenton_6Fenton_6getWavelength};
7614static PyObject *__pyx_pw_6fenton_6Fenton_7getWavelength(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
7615 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7616 PyObject *__pyx_r = 0;
7617 __Pyx_RefNannyDeclarations
7618 __Pyx_RefNannySetupContext("getWavelength (wrapper)", 0);
7619 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
7620 __pyx_r = __pyx_pf_6fenton_6Fenton_6getWavelength(__pyx_self);
7621
7622 /* function exit code */
7623 __Pyx_RefNannyFinishContext();
7624 return __pyx_r;
7625}
7626
7627static PyObject *__pyx_pf_6fenton_6Fenton_6getWavelength(CYTHON_UNUSED PyObject *__pyx_self) {
7628 PyObject *__pyx_v_wavelength = NULL;
7629 PyObject *__pyx_v_f = NULL;
7630 PyObject *__pyx_v_line = NULL;
7631 PyObject *__pyx_v_l = NULL;
7632 PyObject *__pyx_r = NULL;
7633 __Pyx_RefNannyDeclarations
7634 PyObject *__pyx_t_1 = NULL;
7635 PyObject *__pyx_t_2 = NULL;
7636 PyObject *__pyx_t_3 = NULL;
7637 PyObject *__pyx_t_4 = NULL;
7638 PyObject *__pyx_t_5 = NULL;
7639 size_t __pyx_t_6;
7640 PyObject *__pyx_t_7 = NULL;
7641 PyObject *__pyx_t_8 = NULL;
7642 PyObject *__pyx_t_9 = NULL;
7643 Py_ssize_t __pyx_t_10;
7644 PyObject *(*__pyx_t_11)(PyObject *);
7645 int __pyx_t_12;
7646 int __pyx_t_13;
7647 PyObject *__pyx_t_14 = NULL;
7648 int __pyx_lineno = 0;
7649 const char *__pyx_filename = NULL;
7650 int __pyx_clineno = 0;
7651 __Pyx_RefNannySetupContext("getWavelength", 0);
7652
7653 /* "fenton/Fenton.pyx":145
7654 * wavelength
7655 * '''
7656 * wavelength = None # <<<<<<<<<<<<<<
7657 * with open('Solution.res', 'r') as f:
7658 * for line in f:
7659*/
7660 __Pyx_INCREF(Py_None);
7661 __pyx_v_wavelength = Py_None;
7662
7663 /* "fenton/Fenton.pyx":146
7664 * '''
7665 * wavelength = None
7666 * with open('Solution.res', 'r') as f: # <<<<<<<<<<<<<<
7667 * for line in f:
7668 * l = line.split()
7669*/
7670 /*with:*/ {
7671 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_mstate_global->__pyx_tuple[6], NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error)
7672 __Pyx_GOTREF(__pyx_t_1);
7673 __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error)
7674 __Pyx_GOTREF(__pyx_t_2);
7675 __pyx_t_4 = NULL;
7676 __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 146, __pyx_L3_error)
7677 __Pyx_GOTREF(__pyx_t_5);
7678 __pyx_t_6 = 1;
7679 #if CYTHON_UNPACK_METHODS
7680 if (likely(PyMethod_Check(__pyx_t_5))) {
7681 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
7682 assert(__pyx_t_4);
7683 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
7684 __Pyx_INCREF(__pyx_t_4);
7685 __Pyx_INCREF(__pyx__function);
7686 __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
7687 __pyx_t_6 = 0;
7688 }
7689 #endif
7690 {
7691 PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
7692 __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
7693 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7694 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7695 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L3_error)
7696 __Pyx_GOTREF(__pyx_t_3);
7697 }
7698 __pyx_t_5 = __pyx_t_3;
7699 __pyx_t_3 = 0;
7700 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7701 /*try:*/ {
7702 {
7703 __Pyx_PyThreadState_declare
7704 __Pyx_PyThreadState_assign
7705 __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
7706 __Pyx_XGOTREF(__pyx_t_7);
7707 __Pyx_XGOTREF(__pyx_t_8);
7708 __Pyx_XGOTREF(__pyx_t_9);
7709 /*try:*/ {
7710 __pyx_v_f = __pyx_t_5;
7711 __pyx_t_5 = 0;
7712
7713 /* "fenton/Fenton.pyx":147
7714 * wavelength = None
7715 * with open('Solution.res', 'r') as f:
7716 * for line in f: # <<<<<<<<<<<<<<
7717 * l = line.split()
7718 * if 'Wave' in l and 'length' in l:
7719*/
7720 if (likely(PyList_CheckExact(__pyx_v_f)) || PyTuple_CheckExact(__pyx_v_f)) {
7721 __pyx_t_5 = __pyx_v_f; __Pyx_INCREF(__pyx_t_5);
7722 __pyx_t_10 = 0;
7723 __pyx_t_11 = NULL;
7724 } else {
7725 __pyx_t_10 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_f); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 147, __pyx_L7_error)
7726 __Pyx_GOTREF(__pyx_t_5);
7727 __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 147, __pyx_L7_error)
7728 }
7729 for (;;) {
7730 if (likely(!__pyx_t_11)) {
7731 if (likely(PyList_CheckExact(__pyx_t_5))) {
7732 {
7733 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
7734 #if !CYTHON_ASSUME_SAFE_SIZE
7735 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 147, __pyx_L7_error)
7736 #endif
7737 if (__pyx_t_10 >= __pyx_temp) break;
7738 }
7739 __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_5, __pyx_t_10, __Pyx_ReferenceSharing_OwnStrongReference);
7740 ++__pyx_t_10;
7741 } else {
7742 {
7743 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
7744 #if !CYTHON_ASSUME_SAFE_SIZE
7745 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 147, __pyx_L7_error)
7746 #endif
7747 if (__pyx_t_10 >= __pyx_temp) break;
7748 }
7749 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7750 __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_10));
7751 #else
7752 __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_10);
7753 #endif
7754 ++__pyx_t_10;
7755 }
7756 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L7_error)
7757 } else {
7758 __pyx_t_1 = __pyx_t_11(__pyx_t_5);
7759 if (unlikely(!__pyx_t_1)) {
7760 PyObject* exc_type = PyErr_Occurred();
7761 if (exc_type) {
7762 if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 147, __pyx_L7_error)
7763 PyErr_Clear();
7764 }
7765 break;
7766 }
7767 }
7768 __Pyx_GOTREF(__pyx_t_1);
7769 __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_1);
7770 __pyx_t_1 = 0;
7771
7772 /* "fenton/Fenton.pyx":148
7773 * with open('Solution.res', 'r') as f:
7774 * for line in f:
7775 * l = line.split() # <<<<<<<<<<<<<<
7776 * if 'Wave' in l and 'length' in l:
7777 * wavelength = l[5]
7778*/
7779 __pyx_t_3 = __pyx_v_line;
7780 __Pyx_INCREF(__pyx_t_3);
7781 __pyx_t_6 = 0;
7782 {
7783 PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
7784 __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_split, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
7785 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7786 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L7_error)
7787 __Pyx_GOTREF(__pyx_t_1);
7788 }
7789 __Pyx_XDECREF_SET(__pyx_v_l, __pyx_t_1);
7790 __pyx_t_1 = 0;
7791
7792 /* "fenton/Fenton.pyx":149
7793 * for line in f:
7794 * l = line.split()
7795 * if 'Wave' in l and 'length' in l: # <<<<<<<<<<<<<<
7796 * wavelength = l[5]
7797 * return float(wavelength)
7798*/
7799 __pyx_t_13 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_n_u_Wave, __pyx_v_l, Py_EQ)); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 149, __pyx_L7_error)
7800 if (__pyx_t_13) {
7801
7802 } else {
7803
7804 __pyx_t_12 = __pyx_t_13;
7805
7806 goto __pyx_L16_bool_binop_done;
7807 }
7808 __pyx_t_13 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_n_u_length, __pyx_v_l, Py_EQ)); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 149, __pyx_L7_error)
7809
7810 __pyx_t_12 = __pyx_t_13;
7811
7812 __pyx_L16_bool_binop_done:;
7813 if (__pyx_t_12) {
7814
7815
7816 /* "fenton/Fenton.pyx":150
7817 * l = line.split()
7818 * if 'Wave' in l and 'length' in l:
7819 * wavelength = l[5] # <<<<<<<<<<<<<<
7820 * return float(wavelength)
7821 *
7822*/
7823 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_l, 5, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L7_error)
7824 __Pyx_GOTREF(__pyx_t_1);
7825 __Pyx_DECREF_SET(__pyx_v_wavelength, __pyx_t_1);
7826 __pyx_t_1 = 0;
7827
7828 /* "fenton/Fenton.pyx":149
7829 * for line in f:
7830 * l = line.split()
7831 * if 'Wave' in l and 'length' in l: # <<<<<<<<<<<<<<
7832 * wavelength = l[5]
7833 * return float(wavelength)
7834*/
7835 }
7836
7837 /* "fenton/Fenton.pyx":147
7838 * wavelength = None
7839 * with open('Solution.res', 'r') as f:
7840 * for line in f: # <<<<<<<<<<<<<<
7841 * l = line.split()
7842 * if 'Wave' in l and 'length' in l:
7843*/
7844 }
7845 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7846
7847 /* "fenton/Fenton.pyx":146
7848 * '''
7849 * wavelength = None
7850 * with open('Solution.res', 'r') as f: # <<<<<<<<<<<<<<
7851 * for line in f:
7852 * l = line.split()
7853*/
7854 }
7855 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
7856 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
7857 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
7858 goto __pyx_L12_try_end;
7859 __pyx_L7_error:;
7860 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7861 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7862 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7863 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7864 /*except:*/ {
7865 __Pyx_AddTraceback("fenton.Fenton.getWavelength", __pyx_clineno, __pyx_lineno, __pyx_filename);
7866 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_3) < 0) __PYX_ERR(0, 146, __pyx_L9_except_error)
7867 __Pyx_XGOTREF(__pyx_t_5);
7868 __Pyx_XGOTREF(__pyx_t_1);
7869 __Pyx_XGOTREF(__pyx_t_3);
7870 {
7871 PyObject* __pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_t_3};
7872 __pyx_t_4 = __Pyx_PyTuple_FromArray(__pyx_temp, 3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L9_except_error)
7873 __Pyx_GOTREF(__pyx_t_4);
7874 }
7875 __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL);
7876 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7877 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7878 if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 146, __pyx_L9_except_error)
7879 __Pyx_GOTREF(__pyx_t_14);
7880 __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_14);
7881 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
7882 if (__pyx_t_12 < (0)) __PYX_ERR(0, 146, __pyx_L9_except_error)
7883 __pyx_t_13 = (!__pyx_t_12);
7884
7885
7886 if (unlikely(__pyx_t_13)) {
7887
7888 __Pyx_GIVEREF(__pyx_t_5);
7889 __Pyx_GIVEREF(__pyx_t_1);
7890 __Pyx_XGIVEREF(__pyx_t_3);
7891 __Pyx_ErrRestoreWithState(__pyx_t_5, __pyx_t_1, __pyx_t_3);
7892 __pyx_t_5 = 0; __pyx_t_1 = 0; __pyx_t_3 = 0;
7893 __PYX_ERR(0, 146, __pyx_L9_except_error)
7894 }
7895 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7896 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7897 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7898 goto __pyx_L8_exception_handled;
7899 }
7900 __pyx_L9_except_error:;
7901 __Pyx_XGIVEREF(__pyx_t_7);
7902 __Pyx_XGIVEREF(__pyx_t_8);
7903 __Pyx_XGIVEREF(__pyx_t_9);
7904 __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
7905 goto __pyx_L1_error;
7906 __pyx_L8_exception_handled:;
7907 __Pyx_XGIVEREF(__pyx_t_7);
7908 __Pyx_XGIVEREF(__pyx_t_8);
7909 __Pyx_XGIVEREF(__pyx_t_9);
7910 __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
7911 __pyx_L12_try_end:;
7912 }
7913 }
7914 /*finally:*/ {
7915 /*normal exit:*/{
7916 if (__pyx_t_2) {
7917 __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[1], NULL);
7918 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7919 if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 146, __pyx_L1_error)
7920 __Pyx_GOTREF(__pyx_t_9);
7921 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7922 }
7923 goto __pyx_L6;
7924 }
7925 __pyx_L6:;
7926 }
7927 goto __pyx_L22;
7928 __pyx_L3_error:;
7929 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7930 goto __pyx_L1_error;
7931 __pyx_L22:;
7932 }
7933
7934 /* "fenton/Fenton.pyx":151
7935 * if 'Wave' in l and 'length' in l:
7936 * wavelength = l[5]
7937 * return float(wavelength) # <<<<<<<<<<<<<<
7938 *
7939 *
7940*/
7941 __pyx_t_3 = __Pyx_PyNumber_Float(__pyx_v_wavelength); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 151, __pyx_L1_error)
7942 __Pyx_GOTREF(__pyx_t_3);
7943 if (__Pyx_PyFloat_FromNumber(&__pyx_t_3, NULL, 0) < (0)) __PYX_ERR(0, 151, __pyx_L1_error)
7944 {
7945 PyObject *__pyx_temp;
7946 {
7947 __pyx_temp = __pyx_r;
7948 __pyx_r = __pyx_t_3;
7949 }
7950 __Pyx_XDECREF(__pyx_temp);
7951 }
7952 __pyx_t_3 = 0;
7953 goto __pyx_L0;
7954
7955 /* "fenton/Fenton.pyx":130
7956 * return BCoeffs, YCoeffs
7957 *
7958 * def getWavelength(): # <<<<<<<<<<<<<<
7959 * '''
7960 * Get wavelength/depth (dimensionless)
7961*/
7962
7963 /* function exit code */
7964 __pyx_L1_error:;
7965 __Pyx_XDECREF(__pyx_t_1);
7966 __Pyx_XDECREF(__pyx_t_3);
7967 __Pyx_XDECREF(__pyx_t_4);
7968 __Pyx_XDECREF(__pyx_t_5);
7969 __Pyx_AddTraceback("fenton.Fenton.getWavelength", __pyx_clineno, __pyx_lineno, __pyx_filename);
7970 __pyx_r = NULL;
7971 __pyx_L0:;
7972 __Pyx_XDECREF(__pyx_v_wavelength);
7973 __Pyx_XDECREF(__pyx_v_f);
7974 __Pyx_XDECREF(__pyx_v_line);
7975 __Pyx_XDECREF(__pyx_v_l);
7976 __Pyx_XGIVEREF(__pyx_r);
7977 __Pyx_RefNannyFinishContext();
7978 return __pyx_r;
7979}
7980
7981/* "fenton/Fenton.pyx":154
7982 *
7983 *
7984 * def copyFiles(): # <<<<<<<<<<<<<<
7985 * '''
7986 * Copy the files to log directory
7987*/
7988
7989/* Python wrapper */
7990static PyObject *__pyx_pw_6fenton_6Fenton_9copyFiles(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
7991PyDoc_STRVAR(__pyx_doc_6fenton_6Fenton_8copyFiles, "\n Copy the files to log directory\n ");
7992static PyMethodDef __pyx_mdef_6fenton_6Fenton_9copyFiles = {"copyFiles", (PyCFunction)__pyx_pw_6fenton_6Fenton_9copyFiles, METH_NOARGS, __pyx_doc_6fenton_6Fenton_8copyFiles};
7993static PyObject *__pyx_pw_6fenton_6Fenton_9copyFiles(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
7994 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7995 PyObject *__pyx_r = 0;
7996 __Pyx_RefNannyDeclarations
7997 __Pyx_RefNannySetupContext("copyFiles (wrapper)", 0);
7998 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
7999 __pyx_r = __pyx_pf_6fenton_6Fenton_8copyFiles(__pyx_self);
8000
8001 /* function exit code */
8002 __Pyx_RefNannyFinishContext();
8003 return __pyx_r;
8004}
8005
8006static PyObject *__pyx_pf_6fenton_6Fenton_8copyFiles(CYTHON_UNUSED PyObject *__pyx_self) {
8007 PyObject *__pyx_r = NULL;
8008 __Pyx_RefNannyDeclarations
8009 PyObject *__pyx_t_1 = NULL;
8010 PyObject *__pyx_t_2 = NULL;
8011 int __pyx_t_3;
8012 PyObject *__pyx_t_4 = NULL;
8013 PyObject *__pyx_t_5 = NULL;
8014 PyObject *__pyx_t_6 = NULL;
8015 size_t __pyx_t_7;
8016 int __pyx_lineno = 0;
8017 const char *__pyx_filename = NULL;
8018 int __pyx_clineno = 0;
8019 __Pyx_RefNannySetupContext("copyFiles", 0);
8020
8021 /* "fenton/Fenton.pyx":158
8022 * Copy the files to log directory
8023 * '''
8024 * if Profiling.logDir != '.': # <<<<<<<<<<<<<<
8025 * copy('Data.dat',Profiling.logDir)
8026 * copy('Convergence.dat',Profiling.logDir)
8027*/
8028 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Profiling); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
8029 __Pyx_GOTREF(__pyx_t_1);
8030 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_logDir); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error)
8031 __Pyx_GOTREF(__pyx_t_2);
8032 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8033 __pyx_t_3 = (__Pyx_PyObject_Equals_obj_ch46(__pyx_t_2, __pyx_mstate_global->__pyx_kp_u__3, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 158, __pyx_L1_error)
8034 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8035 if (__pyx_t_3) {
8036
8037
8038 /* "fenton/Fenton.pyx":159
8039 * '''
8040 * if Profiling.logDir != '.':
8041 * copy('Data.dat',Profiling.logDir) # <<<<<<<<<<<<<<
8042 * copy('Convergence.dat',Profiling.logDir)
8043 * copy('Points.dat',Profiling.logDir)
8044*/
8045 __pyx_t_1 = NULL;
8046 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error)
8047 __Pyx_GOTREF(__pyx_t_4);
8048 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Profiling); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 159, __pyx_L1_error)
8049 __Pyx_GOTREF(__pyx_t_5);
8050 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_logDir); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 159, __pyx_L1_error)
8051 __Pyx_GOTREF(__pyx_t_6);
8052 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8053 __pyx_t_7 = 1;
8054 #if CYTHON_UNPACK_METHODS
8055 if (unlikely(PyMethod_Check(__pyx_t_4))) {
8056 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
8057 assert(__pyx_t_1);
8058 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
8059 __Pyx_INCREF(__pyx_t_1);
8060 __Pyx_INCREF(__pyx__function);
8061 __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
8062 __pyx_t_7 = 0;
8063 }
8064 #endif
8065 {
8066 PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_Data_dat, __pyx_t_6};
8067 __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
8068 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8069 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8070 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8071 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
8072 __Pyx_GOTREF(__pyx_t_2);
8073 }
8074 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8075
8076 /* "fenton/Fenton.pyx":160
8077 * if Profiling.logDir != '.':
8078 * copy('Data.dat',Profiling.logDir)
8079 * copy('Convergence.dat',Profiling.logDir) # <<<<<<<<<<<<<<
8080 * copy('Points.dat',Profiling.logDir)
8081 * copy('Solution.res',Profiling.logDir)
8082*/
8083 __pyx_t_4 = NULL;
8084 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_copy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 160, __pyx_L1_error)
8085 __Pyx_GOTREF(__pyx_t_6);
8086 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Profiling); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error)
8087 __Pyx_GOTREF(__pyx_t_1);
8088 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_logDir); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 160, __pyx_L1_error)
8089 __Pyx_GOTREF(__pyx_t_5);
8090 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8091 __pyx_t_7 = 1;
8092 #if CYTHON_UNPACK_METHODS
8093 if (unlikely(PyMethod_Check(__pyx_t_6))) {
8094 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
8095 assert(__pyx_t_4);
8096 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
8097 __Pyx_INCREF(__pyx_t_4);
8098 __Pyx_INCREF(__pyx__function);
8099 __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
8100 __pyx_t_7 = 0;
8101 }
8102 #endif
8103 {
8104 PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Convergence_dat, __pyx_t_5};
8105 __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
8106 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8107 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8108 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8109 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error)
8110 __Pyx_GOTREF(__pyx_t_2);
8111 }
8112 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8113
8114 /* "fenton/Fenton.pyx":161
8115 * copy('Data.dat',Profiling.logDir)
8116 * copy('Convergence.dat',Profiling.logDir)
8117 * copy('Points.dat',Profiling.logDir) # <<<<<<<<<<<<<<
8118 * copy('Solution.res',Profiling.logDir)
8119 * copy('Surface.res',Profiling.logDir)
8120*/
8121 __pyx_t_6 = NULL;
8122 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_copy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 161, __pyx_L1_error)
8123 __Pyx_GOTREF(__pyx_t_5);
8124 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Profiling); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 161, __pyx_L1_error)
8125 __Pyx_GOTREF(__pyx_t_4);
8126 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_logDir); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
8127 __Pyx_GOTREF(__pyx_t_1);
8128 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8129 __pyx_t_7 = 1;
8130 #if CYTHON_UNPACK_METHODS
8131 if (unlikely(PyMethod_Check(__pyx_t_5))) {
8132 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
8133 assert(__pyx_t_6);
8134 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
8135 __Pyx_INCREF(__pyx_t_6);
8136 __Pyx_INCREF(__pyx__function);
8137 __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
8138 __pyx_t_7 = 0;
8139 }
8140 #endif
8141 {
8142 PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_Points_dat, __pyx_t_1};
8143 __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
8144 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8145 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8146 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8147 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error)
8148 __Pyx_GOTREF(__pyx_t_2);
8149 }
8150 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8151
8152 /* "fenton/Fenton.pyx":162
8153 * copy('Convergence.dat',Profiling.logDir)
8154 * copy('Points.dat',Profiling.logDir)
8155 * copy('Solution.res',Profiling.logDir) # <<<<<<<<<<<<<<
8156 * copy('Surface.res',Profiling.logDir)
8157 * copy('Flowfield.res',Profiling.logDir)
8158*/
8159 __pyx_t_5 = NULL;
8160 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error)
8161 __Pyx_GOTREF(__pyx_t_1);
8162 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_Profiling); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 162, __pyx_L1_error)
8163 __Pyx_GOTREF(__pyx_t_6);
8164 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_logDir); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 162, __pyx_L1_error)
8165 __Pyx_GOTREF(__pyx_t_4);
8166 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8167 __pyx_t_7 = 1;
8168 #if CYTHON_UNPACK_METHODS
8169 if (unlikely(PyMethod_Check(__pyx_t_1))) {
8170 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
8171 assert(__pyx_t_5);
8172 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
8173 __Pyx_INCREF(__pyx_t_5);
8174 __Pyx_INCREF(__pyx__function);
8175 __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
8176 __pyx_t_7 = 0;
8177 }
8178 #endif
8179 {
8180 PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_Solution_res, __pyx_t_4};
8181 __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
8182 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8183 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8184 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8185 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error)
8186 __Pyx_GOTREF(__pyx_t_2);
8187 }
8188 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8189
8190 /* "fenton/Fenton.pyx":163
8191 * copy('Points.dat',Profiling.logDir)
8192 * copy('Solution.res',Profiling.logDir)
8193 * copy('Surface.res',Profiling.logDir) # <<<<<<<<<<<<<<
8194 * copy('Flowfield.res',Profiling.logDir)
8195 *
8196*/
8197 __pyx_t_1 = NULL;
8198 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error)
8199 __Pyx_GOTREF(__pyx_t_4);
8200 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Profiling); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 163, __pyx_L1_error)
8201 __Pyx_GOTREF(__pyx_t_5);
8202 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_logDir); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 163, __pyx_L1_error)
8203 __Pyx_GOTREF(__pyx_t_6);
8204 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8205 __pyx_t_7 = 1;
8206 #if CYTHON_UNPACK_METHODS
8207 if (unlikely(PyMethod_Check(__pyx_t_4))) {
8208 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
8209 assert(__pyx_t_1);
8210 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
8211 __Pyx_INCREF(__pyx_t_1);
8212 __Pyx_INCREF(__pyx__function);
8213 __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
8214 __pyx_t_7 = 0;
8215 }
8216 #endif
8217 {
8218 PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_Surface_res, __pyx_t_6};
8219 __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
8220 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8221 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8222 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8223 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error)
8224 __Pyx_GOTREF(__pyx_t_2);
8225 }
8226 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8227
8228 /* "fenton/Fenton.pyx":164
8229 * copy('Solution.res',Profiling.logDir)
8230 * copy('Surface.res',Profiling.logDir)
8231 * copy('Flowfield.res',Profiling.logDir) # <<<<<<<<<<<<<<
8232 *
8233 * def __get_dir():
8234*/
8235 __pyx_t_4 = NULL;
8236 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_copy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 164, __pyx_L1_error)
8237 __Pyx_GOTREF(__pyx_t_6);
8238 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Profiling); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error)
8239 __Pyx_GOTREF(__pyx_t_1);
8240 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_logDir); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 164, __pyx_L1_error)
8241 __Pyx_GOTREF(__pyx_t_5);
8242 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8243 __pyx_t_7 = 1;
8244 #if CYTHON_UNPACK_METHODS
8245 if (unlikely(PyMethod_Check(__pyx_t_6))) {
8246 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
8247 assert(__pyx_t_4);
8248 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
8249 __Pyx_INCREF(__pyx_t_4);
8250 __Pyx_INCREF(__pyx__function);
8251 __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
8252 __pyx_t_7 = 0;
8253 }
8254 #endif
8255 {
8256 PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Flowfield_res, __pyx_t_5};
8257 __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
8258 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8259 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8260 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8261 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __pyx_L1_error)
8262 __Pyx_GOTREF(__pyx_t_2);
8263 }
8264 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8265
8266 /* "fenton/Fenton.pyx":158
8267 * Copy the files to log directory
8268 * '''
8269 * if Profiling.logDir != '.': # <<<<<<<<<<<<<<
8270 * copy('Data.dat',Profiling.logDir)
8271 * copy('Convergence.dat',Profiling.logDir)
8272*/
8273 }
8274
8275 /* "fenton/Fenton.pyx":154
8276 *
8277 *
8278 * def copyFiles(): # <<<<<<<<<<<<<<
8279 * '''
8280 * Copy the files to log directory
8281*/
8282
8283 /* function exit code */
8284 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8285 goto __pyx_L0;
8286 __pyx_L1_error:;
8287 __Pyx_XDECREF(__pyx_t_1);
8288 __Pyx_XDECREF(__pyx_t_2);
8289 __Pyx_XDECREF(__pyx_t_4);
8290 __Pyx_XDECREF(__pyx_t_5);
8291 __Pyx_XDECREF(__pyx_t_6);
8292 __Pyx_AddTraceback("fenton.Fenton.copyFiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
8293 __pyx_r = NULL;
8294 __pyx_L0:;
8295 __Pyx_XGIVEREF(__pyx_r);
8296 __Pyx_RefNannyFinishContext();
8297 return __pyx_r;
8298}
8299
8300/* "fenton/Fenton.pyx":166
8301 * copy('Flowfield.res',Profiling.logDir)
8302 *
8303 * def __get_dir(): # <<<<<<<<<<<<<<
8304 * return os.path.dirname(__file__)
8305*/
8306
8307/* Python wrapper */
8308static PyObject *__pyx_pw_6fenton_6Fenton_11__get_dir(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
8309static PyMethodDef __pyx_mdef_6fenton_6Fenton_11__get_dir = {"__get_dir", (PyCFunction)__pyx_pw_6fenton_6Fenton_11__get_dir, METH_NOARGS, 0};
8310static PyObject *__pyx_pw_6fenton_6Fenton_11__get_dir(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
8311 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
8312 PyObject *__pyx_r = 0;
8313 __Pyx_RefNannyDeclarations
8314 __Pyx_RefNannySetupContext("__get_dir (wrapper)", 0);
8315 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
8316 __pyx_r = __pyx_pf_6fenton_6Fenton_10__get_dir(__pyx_self);
8317
8318 /* function exit code */
8319 __Pyx_RefNannyFinishContext();
8320 return __pyx_r;
8321}
8322
8323static PyObject *__pyx_pf_6fenton_6Fenton_10__get_dir(CYTHON_UNUSED PyObject *__pyx_self) {
8324 PyObject *__pyx_r = NULL;
8325 __Pyx_RefNannyDeclarations
8326 PyObject *__pyx_t_1 = NULL;
8327 PyObject *__pyx_t_2 = NULL;
8328 PyObject *__pyx_t_3 = NULL;
8329 PyObject *__pyx_t_4 = NULL;
8330 size_t __pyx_t_5;
8331 int __pyx_lineno = 0;
8332 const char *__pyx_filename = NULL;
8333 int __pyx_clineno = 0;
8334 __Pyx_RefNannySetupContext("__get_dir", 0);
8335
8336 /* "fenton/Fenton.pyx":167
8337 *
8338 * def __get_dir():
8339 * return os.path.dirname(__file__) # <<<<<<<<<<<<<<
8340*/
8341 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L1_error)
8342 __Pyx_GOTREF(__pyx_t_3);
8343 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error)
8344 __Pyx_GOTREF(__pyx_t_4);
8345 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8346 __pyx_t_2 = __pyx_t_4;
8347 __Pyx_INCREF(__pyx_t_2);
8348 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_file); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L1_error)
8349 __Pyx_GOTREF(__pyx_t_3);
8350 __pyx_t_5 = 0;
8351 {
8352 PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
8353 __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_dirname, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
8354 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8355 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8356 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8357 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error)
8358 __Pyx_GOTREF(__pyx_t_1);
8359 }
8360 {
8361 PyObject *__pyx_temp;
8362 {
8363 __pyx_temp = __pyx_r;
8364 __pyx_r = __pyx_t_1;
8365 }
8366 __Pyx_XDECREF(__pyx_temp);
8367 }
8368 __pyx_t_1 = 0;
8369 goto __pyx_L0;
8370
8371 /* "fenton/Fenton.pyx":166
8372 * copy('Flowfield.res',Profiling.logDir)
8373 *
8374 * def __get_dir(): # <<<<<<<<<<<<<<
8375 * return os.path.dirname(__file__)
8376*/
8377
8378 /* function exit code */
8379 __pyx_L1_error:;
8380 __Pyx_XDECREF(__pyx_t_1);
8381 __Pyx_XDECREF(__pyx_t_2);
8382 __Pyx_XDECREF(__pyx_t_3);
8383 __Pyx_XDECREF(__pyx_t_4);
8384 __Pyx_AddTraceback("fenton.Fenton.__get_dir", __pyx_clineno, __pyx_lineno, __pyx_filename);
8385 __pyx_r = NULL;
8386 __pyx_L0:;
8387 __Pyx_XGIVEREF(__pyx_r);
8388 __Pyx_RefNannyFinishContext();
8389 return __pyx_r;
8390}
8391/* #### Code section: module_exttypes ### */
8392
8393static PyMethodDef __pyx_methods[] = {
8394 {0, 0, 0, 0}
8395};
8396/* #### Code section: initfunc_declarations ### */
8397static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/
8398static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
8399static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/
8400static CYTHON_SMALL_CODE int __Pyx_InitAfterSharedUtility(void); /*proto*/
8401static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
8402static CYTHON_SMALL_CODE int __Pyx_modinit_Global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
8403static CYTHON_SMALL_CODE int __Pyx_modinit_Variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
8404static CYTHON_SMALL_CODE int __Pyx_modinit_Function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
8405static CYTHON_SMALL_CODE int __Pyx_modinit_Type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
8406static CYTHON_SMALL_CODE int __Pyx_modinit_Variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
8407static CYTHON_SMALL_CODE int __Pyx_modinit_Function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
8408static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/
8409/* #### Code section: init_module ### */
8410
8411static int __Pyx_modinit_Global_init_code(__pyx_mstatetype *__pyx_mstate) {
8412 __Pyx_RefNannyDeclarations
8413 CYTHON_UNUSED_VAR(__pyx_mstate);
8414 __Pyx_RefNannySetupContext("__Pyx_modinit_Global_init_code", 0);
8415 /*--- Global init code ---*/
8416 __Pyx_RefNannyFinishContext();
8417 return 0;
8418}
8419
8420static int __Pyx_modinit_Variable_export_code(__pyx_mstatetype *__pyx_mstate) {
8421 __Pyx_RefNannyDeclarations
8422 CYTHON_UNUSED_VAR(__pyx_mstate);
8423 __Pyx_RefNannySetupContext("__Pyx_modinit_Variable_export_code", 0);
8424 /*--- Variable export code ---*/
8425 __Pyx_RefNannyFinishContext();
8426 return 0;
8427}
8428
8429static int __Pyx_modinit_Function_export_code(__pyx_mstatetype *__pyx_mstate) {
8430 __Pyx_RefNannyDeclarations
8431 CYTHON_UNUSED_VAR(__pyx_mstate);
8432 __Pyx_RefNannySetupContext("__Pyx_modinit_Function_export_code", 0);
8433 /*--- Function export code ---*/
8434 __Pyx_RefNannyFinishContext();
8435 return 0;
8436}
8437
8438static int __Pyx_modinit_Type_import_code(__pyx_mstatetype *__pyx_mstate) {
8439 __Pyx_RefNannyDeclarations
8440 PyObject *__pyx_t_1 = NULL;
8441 int __pyx_lineno = 0;
8442 const char *__pyx_filename = NULL;
8443 int __pyx_clineno = 0;
8444 CYTHON_UNUSED_VAR(__pyx_mstate);
8445 __Pyx_RefNannySetupContext("__Pyx_modinit_Type_import_code", 0);
8446 /*--- Type import code ---*/
8447 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error)
8448 __Pyx_GOTREF(__pyx_t_1);
8449 __pyx_mstate->__pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_3_0(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
8450 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
8451 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyTypeObject),
8452 #elif CYTHON_COMPILING_IN_LIMITED_API
8453 0, 0,
8454 #else
8455 sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyHeapTypeObject),
8456 #endif
8457 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error)
8458 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8459 __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 229, __pyx_L1_error)
8460 __Pyx_GOTREF(__pyx_t_1);
8461 __pyx_mstate->__pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "dtype",
8462 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
8463 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
8464 #elif CYTHON_COMPILING_IN_LIMITED_API
8465 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
8466 #else
8467 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
8468 #endif
8469 __Pyx_ImportType_CheckSize_Ignore_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 229, __pyx_L1_error)
8470 __pyx_mstate->__pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "flatiter",
8471 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
8472 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
8473 #elif CYTHON_COMPILING_IN_LIMITED_API
8474 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
8475 #else
8476 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
8477 #endif
8478 __Pyx_ImportType_CheckSize_Ignore_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 286, __pyx_L1_error)
8479 __pyx_mstate->__pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "broadcast",
8480 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
8481 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
8482 #elif CYTHON_COMPILING_IN_LIMITED_API
8483 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
8484 #else
8485 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
8486 #endif
8487 __Pyx_ImportType_CheckSize_Ignore_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 290, __pyx_L1_error)
8488 __pyx_mstate->__pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "ndarray",
8489 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
8490 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
8491 #elif CYTHON_COMPILING_IN_LIMITED_API
8492 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
8493 #else
8494 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
8495 #endif
8496 __Pyx_ImportType_CheckSize_Ignore_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 329, __pyx_L1_error)
8497 __pyx_mstate->__pyx_ptype_5numpy_generic = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "generic",
8498 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
8499 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8500 #elif CYTHON_COMPILING_IN_LIMITED_API
8501 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8502 #else
8503 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8504 #endif
8505 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_generic) __PYX_ERR(1, 847, __pyx_L1_error)
8506 __pyx_mstate->__pyx_ptype_5numpy_number = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "number",
8507 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
8508 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8509 #elif CYTHON_COMPILING_IN_LIMITED_API
8510 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8511 #else
8512 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8513 #endif
8514 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_number) __PYX_ERR(1, 849, __pyx_L1_error)
8515 __pyx_mstate->__pyx_ptype_5numpy_integer = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "integer",
8516 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
8517 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8518 #elif CYTHON_COMPILING_IN_LIMITED_API
8519 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8520 #else
8521 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8522 #endif
8523 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_integer) __PYX_ERR(1, 851, __pyx_L1_error)
8524 __pyx_mstate->__pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "signedinteger",
8525 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
8526 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8527 #elif CYTHON_COMPILING_IN_LIMITED_API
8528 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8529 #else
8530 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8531 #endif
8532 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 853, __pyx_L1_error)
8533 __pyx_mstate->__pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "unsignedinteger",
8534 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
8535 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8536 #elif CYTHON_COMPILING_IN_LIMITED_API
8537 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8538 #else
8539 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8540 #endif
8541 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 855, __pyx_L1_error)
8542 __pyx_mstate->__pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "inexact",
8543 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
8544 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8545 #elif CYTHON_COMPILING_IN_LIMITED_API
8546 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8547 #else
8548 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8549 #endif
8550 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 857, __pyx_L1_error)
8551 __pyx_mstate->__pyx_ptype_5numpy_floating = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "floating",
8552 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
8553 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8554 #elif CYTHON_COMPILING_IN_LIMITED_API
8555 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8556 #else
8557 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8558 #endif
8559 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_floating) __PYX_ERR(1, 859, __pyx_L1_error)
8560 __pyx_mstate->__pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "complexfloating",
8561 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
8562 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8563 #elif CYTHON_COMPILING_IN_LIMITED_API
8564 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8565 #else
8566 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8567 #endif
8568 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 861, __pyx_L1_error)
8569 __pyx_mstate->__pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "flexible",
8570 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
8571 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8572 #elif CYTHON_COMPILING_IN_LIMITED_API
8573 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8574 #else
8575 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8576 #endif
8577 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 863, __pyx_L1_error)
8578 __pyx_mstate->__pyx_ptype_5numpy_character = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "character",
8579 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
8580 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8581 #elif CYTHON_COMPILING_IN_LIMITED_API
8582 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8583 #else
8584 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8585 #endif
8586 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_character) __PYX_ERR(1, 865, __pyx_L1_error)
8587 __pyx_mstate->__pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "ufunc",
8588 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
8589 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
8590 #elif CYTHON_COMPILING_IN_LIMITED_API
8591 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
8592 #else
8593 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
8594 #endif
8595 __Pyx_ImportType_CheckSize_Ignore_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 946, __pyx_L1_error)
8596 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8597 __Pyx_RefNannyFinishContext();
8598 return 0;
8599 __pyx_L1_error:;
8600 __Pyx_XDECREF(__pyx_t_1);
8601 __Pyx_RefNannyFinishContext();
8602 return -1;
8603}
8604
8605static int __Pyx_modinit_Variable_import_code(__pyx_mstatetype *__pyx_mstate) {
8606 __Pyx_RefNannyDeclarations
8607 CYTHON_UNUSED_VAR(__pyx_mstate);
8608 __Pyx_RefNannySetupContext("__Pyx_modinit_Variable_import_code", 0);
8609 /*--- Variable import code ---*/
8610 __Pyx_RefNannyFinishContext();
8611 return 0;
8612}
8613
8614static int __Pyx_modinit_Function_import_code(__pyx_mstatetype *__pyx_mstate) {
8615 __Pyx_RefNannyDeclarations
8616 CYTHON_UNUSED_VAR(__pyx_mstate);
8617 __Pyx_RefNannySetupContext("__Pyx_modinit_Function_import_code", 0);
8618 /*--- Function import code ---*/
8619 __Pyx_RefNannyFinishContext();
8620 return 0;
8621}
8622
8623#if CYTHON_PEP489_MULTI_PHASE_INIT
8624static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
8625static int __pyx_pymod_exec_Fenton(PyObject* module); /*proto*/
8626static PyModuleDef_Slot __pyx_moduledef_slots[] = {
8627 {Py_mod_create, (void*)__pyx_pymod_create},
8628 {Py_mod_exec, (void*)__pyx_pymod_exec_Fenton},
8629 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
8630 {Py_mod_gil, __Pyx_FREETHREADING_COMPATIBLE},
8631 #endif
8632 #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE
8633 {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
8634 #endif
8635 {0, NULL}
8636};
8637#endif
8638
8639#ifdef __cplusplus
8640namespace {
8641 struct PyModuleDef __pyx_moduledef =
8642 #else
8643 static struct PyModuleDef __pyx_moduledef =
8644 #endif
8645 {
8646 PyModuleDef_HEAD_INIT,
8647 "Fenton",
8648 __pyx_k_Scripts_for_creating_Fenton_wav, /* m_doc */
8649 #if CYTHON_USE_MODULE_STATE
8650 sizeof(__pyx_mstatetype), /* m_size */
8651 #else
8652 (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -1, /* m_size */
8653 #endif
8654 __pyx_methods /* m_methods */,
8655 #if CYTHON_PEP489_MULTI_PHASE_INIT
8656 __pyx_moduledef_slots, /* m_slots */
8657 #else
8658 NULL, /* m_reload */
8659 #endif
8660 #if CYTHON_USE_MODULE_STATE
8661 __pyx_m_traverse, /* m_traverse */
8662 __pyx_m_clear, /* m_clear */
8663 NULL /* m_free */
8664 #else
8665 NULL, /* m_traverse */
8666 NULL, /* m_clear */
8667 NULL /* m_free */
8668 #endif
8669 };
8670 #ifdef __cplusplus
8671} /* anonymous namespace */
8672#endif
8673
8674/* PyModInitFuncType */
8675#ifndef CYTHON_NO_PYINIT_EXPORT
8676 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
8677#else
8678 #ifdef __cplusplus
8679 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
8680 #else
8681 #define __Pyx_PyMODINIT_FUNC PyObject *
8682 #endif
8683#endif
8684
8685__Pyx_PyMODINIT_FUNC PyInit_Fenton(void) CYTHON_SMALL_CODE; /*proto*/
8686__Pyx_PyMODINIT_FUNC PyInit_Fenton(void)
8687#if CYTHON_PEP489_MULTI_PHASE_INIT
8688{
8689 return PyModuleDef_Init(&__pyx_moduledef);
8690}
8691/* ModuleCreationPEP489 */
8692#if CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x030A0000 &&\
8693 (defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)))
8694static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) {
8695 {
8696 PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think
8697 if (!module) {
8698 if (!PyErr_ExceptionMatches(PyExc_Exception)) {
8699 goto bad; // BaseException
8700 }
8701 PyErr_Clear(); // just try the 3.8-3.12 version
8702 module = PyImport_ImportModule("_xxsubinterpreters");
8703 if (!module) goto bad;
8704 }
8705 PyObject *current = PyObject_CallMethod(module, "get_current", NULL);
8706 Py_DECREF(module);
8707 if (!current) goto bad;
8708 if (PyTuple_Check(current)) {
8709 PyObject *new_current = PySequence_GetItem(current, 0);
8710 Py_DECREF(current);
8711 current = new_current;
8712 if (!new_current) goto bad;
8713 }
8714 long long as_c_int = PyLong_AsLongLong(current);
8715 Py_DECREF(current);
8716 return as_c_int;
8717 }
8718 bad:
8719 PySys_WriteStderr("__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n");
8720 return -1;
8721}
8722#endif
8723#if !CYTHON_USE_MODULE_STATE
8724static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
8725 static PY_INT64_T main_interpreter_id = -1;
8726#if CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
8727 PY_INT64_T current_id = GraalPyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
8728#elif CYTHON_COMPILING_IN_GRAAL
8729 PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
8730#elif CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x030A0000 &&\
8731 (defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)))
8732 PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId();
8733#elif CYTHON_COMPILING_IN_LIMITED_API
8734 PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get());
8735#else
8736 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
8737#endif
8738 if (unlikely(current_id == -1)) {
8739 return -1;
8740 }
8741 if (main_interpreter_id == -1) {
8742 main_interpreter_id = current_id;
8743 return 0;
8744 } else if (unlikely(main_interpreter_id != current_id)) {
8745 PyErr_SetString(
8746 PyExc_ImportError,
8747 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
8748 return -1;
8749 }
8750 return 0;
8751}
8752#endif
8753static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none)
8754{
8755 PyObject *value = PyObject_GetAttrString(spec, from_name);
8756 int result = 0;
8757 if (likely(value)) {
8758 if (allow_none || value != Py_None) {
8759 result = PyDict_SetItemString(moddict, to_name, value);
8760 }
8761 Py_DECREF(value);
8762 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
8763 PyErr_Clear();
8764 } else {
8765 result = -1;
8766 }
8767 return result;
8768}
8769static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
8770 PyObject *module = NULL, *moddict, *modname;
8771 CYTHON_UNUSED_VAR(def);
8772 #if !CYTHON_USE_MODULE_STATE
8773 if (__Pyx_check_single_interpreter())
8774 return NULL;
8775 #endif
8776 if (__pyx_m)
8777 return __Pyx_NewRef(__pyx_m);
8778 modname = PyObject_GetAttrString(spec, "name");
8779 if (unlikely(!modname)) goto bad;
8780 module = PyModule_NewObject(modname);
8781 Py_DECREF(modname);
8782 if (unlikely(!module)) goto bad;
8783 moddict = PyModule_GetDict(module);
8784 if (unlikely(!moddict)) goto bad;
8785 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
8786 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
8787 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
8788 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
8789 return module;
8790bad:
8791 Py_XDECREF(module);
8792 return NULL;
8793}
8794
8795
8796static CYTHON_SMALL_CODE int __pyx_pymod_exec_Fenton(PyObject *__pyx_pyinit_module)
8797#endif
8798{
8799 int stringtab_initialized = 0;
8800 #if CYTHON_USE_MODULE_STATE
8801 int pystate_addmodule_run = 0;
8802 #endif
8803 __pyx_mstatetype *__pyx_mstate = NULL;
8804 PyObject *__pyx_t_1 = NULL;
8805 PyObject *__pyx_t_2 = NULL;
8806 Py_ssize_t __pyx_t_3;
8807 PyObject *__pyx_t_4 = NULL;
8808 int __pyx_lineno = 0;
8809 const char *__pyx_filename = NULL;
8810 int __pyx_clineno = 0;
8811 __Pyx_RefNannyDeclarations
8812 #if CYTHON_PEP489_MULTI_PHASE_INIT
8813 if (__pyx_m) {
8814 if (__pyx_m == __pyx_pyinit_module) return 0;
8815 PyErr_SetString(PyExc_RuntimeError, "Module 'Fenton' has already been imported. Re-initialisation is not supported.");
8816 return -1;
8817 }
8818 #else
8819 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
8820 #endif
8821 /*--- Module creation code ---*/
8822 #if CYTHON_PEP489_MULTI_PHASE_INIT
8823 __pyx_t_1 = __pyx_pyinit_module;
8824 Py_INCREF(__pyx_t_1);
8825 #else
8826 __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
8827 #endif
8828 #if CYTHON_USE_MODULE_STATE
8829 {
8830 int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef);
8831 __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "Fenton" pseudovariable */
8832 if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
8833 pystate_addmodule_run = 1;
8834 }
8835 #else
8836 __pyx_m = __pyx_t_1;
8837 #endif
8838 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
8839 PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_USED);
8840 #endif
8841 __pyx_mstate = __pyx_mstate_global;
8842 CYTHON_UNUSED_VAR(__pyx_t_1);
8843 __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
8844 Py_INCREF(__pyx_mstate->__pyx_d);
8845 __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
8846 __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef("cython_runtime"); if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
8847 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8848 /* ImportRefnannyAPI */
8849 #if CYTHON_REFNANNY
8850 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
8851 if (!__Pyx_RefNanny) {
8852 if (PyErr_ExceptionMatches(PyExc_Exception)) {
8853 PyErr_Clear();
8854 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
8855 }
8856 if (!__Pyx_RefNanny)
8857 Py_FatalError("failed to import 'refnanny' module");
8858 }
8859 #endif
8860
8861__Pyx_RefNannySetupContext("PyInit_Fenton", 0);
8862 __Pyx_init_runtime_version();
8863 if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
8864 __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
8865 __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
8866 __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
8867 /*--- Library function declarations ---*/
8868 /*--- Initialize various global constants etc. ---*/
8869 if (__Pyx_InitConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
8870 stringtab_initialized = 1;
8871 if (__Pyx_InitGlobals() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
8872 if (__pyx_module_is_main_fenton__Fenton) {
8873 if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_main) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
8874 }
8875 {
8876 PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
8877 if (!PyDict_GetItemString(modules, "fenton.Fenton")) {
8878 if (unlikely((PyDict_SetItemString(modules, "fenton.Fenton", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
8879 }
8880 }
8881 /*--- Builtin init code ---*/
8882 if (__Pyx_InitCachedBuiltins(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
8883 /*--- Constants init code ---*/
8884 if (__Pyx_InitCachedConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
8885 if (__Pyx_CreateCodeObjects(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
8886 /*--- Global type/function init code ---*/
8887 (void)__Pyx_modinit_Global_init_code(__pyx_mstate);
8888 (void)__Pyx_modinit_Variable_export_code(__pyx_mstate);
8889 (void)__Pyx_modinit_Function_export_code(__pyx_mstate);
8890 /*--- Type init code ---*/
8891 if (unlikely((__Pyx_modinit_Type_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
8892 (void)__Pyx_modinit_Variable_import_code(__pyx_mstate);
8893 (void)__Pyx_modinit_Function_import_code(__pyx_mstate);
8894 if (__Pyx_InitAfterSharedUtility() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
8895 /*--- Execution code ---*/
8896
8897 /* "fenton/Fenton.pyx":7
8898 * Used in proteus.WaveTools
8899 * """
8900 * import os # <<<<<<<<<<<<<<
8901 * from subprocess import check_call
8902 * from shutil import copy
8903*/
8904 __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_os, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error)
8905 __pyx_t_2 = __pyx_t_1;
8906 __Pyx_GOTREF(__pyx_t_2);
8907 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_os, __pyx_t_2) < (0)) __PYX_ERR(0, 7, __pyx_L1_error)
8908 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8909
8910 /* "fenton/Fenton.pyx":8
8911 * """
8912 * import os
8913 * from subprocess import check_call # <<<<<<<<<<<<<<
8914 * from shutil import copy
8915 * import numpy as np
8916*/
8917 {
8918 PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_check_call};
8919 __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_subprocess, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
8920 }
8921 __pyx_t_2 = __pyx_t_1;
8922 __Pyx_GOTREF(__pyx_t_2);
8923 {
8924 PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_check_call};
8925 __pyx_t_3 = 0; {
8926 __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 8, __pyx_L1_error)
8927 __Pyx_GOTREF(__pyx_t_4);
8928 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 8, __pyx_L1_error)
8929 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8930 }
8931 }
8932 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8933
8934 /* "fenton/Fenton.pyx":9
8935 * import os
8936 * from subprocess import check_call
8937 * from shutil import copy # <<<<<<<<<<<<<<
8938 * import numpy as np
8939 * cimport numpy as np
8940*/
8941 {
8942 PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_copy};
8943 __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_shutil, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
8944 }
8945 __pyx_t_2 = __pyx_t_1;
8946 __Pyx_GOTREF(__pyx_t_2);
8947 {
8948 PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_copy};
8949 __pyx_t_3 = 0; {
8950 __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 9, __pyx_L1_error)
8951 __Pyx_GOTREF(__pyx_t_4);
8952 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 9, __pyx_L1_error)
8953 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8954 }
8955 }
8956 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8957
8958 /* "fenton/Fenton.pyx":10
8959 * from subprocess import check_call
8960 * from shutil import copy
8961 * import numpy as np # <<<<<<<<<<<<<<
8962 * cimport numpy as np
8963 * from proteus import Profiling
8964*/
8965 __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_numpy, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
8966 __pyx_t_2 = __pyx_t_1;
8967 __Pyx_GOTREF(__pyx_t_2);
8968 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_np, __pyx_t_2) < (0)) __PYX_ERR(0, 10, __pyx_L1_error)
8969 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8970
8971 /* "fenton/Fenton.pyx":12
8972 * import numpy as np
8973 * cimport numpy as np
8974 * from proteus import Profiling # <<<<<<<<<<<<<<
8975 *
8976 * cdef extern from "Fourier.cpp":
8977*/
8978 {
8979 PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Profiling};
8980 __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_proteus, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
8981 }
8982 __pyx_t_2 = __pyx_t_1;
8983 __Pyx_GOTREF(__pyx_t_2);
8984 {
8985 PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Profiling};
8986 __pyx_t_3 = 0; {
8987 __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 12, __pyx_L1_error)
8988 __Pyx_GOTREF(__pyx_t_4);
8989 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 12, __pyx_L1_error)
8990 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8991 }
8992 }
8993 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8994
8995 /* "fenton/Fenton.pyx":17
8996 * cdef void runfourier()
8997 *
8998 * def writeInput(waveheight, # <<<<<<<<<<<<<<
8999 * depth,
9000 * period=None,
9001*/
9002 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6fenton_6Fenton_1writeInput, 0, __pyx_mstate_global->__pyx_n_u_writeInput, NULL, __pyx_mstate_global->__pyx_n_u_fenton_Fenton, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error)
9003 __Pyx_GOTREF(__pyx_t_2);
9004 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
9005 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
9006 #endif
9007 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[7]);
9008 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_writeInput, __pyx_t_2) < (0)) __PYX_ERR(0, 17, __pyx_L1_error)
9009 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9010
9011 /* "fenton/Fenton.pyx":106
9012 * '''.format(niter=niter, conv_crit=conv_crit))
9013 *
9014 * def runFourier(): # <<<<<<<<<<<<<<
9015 * '''
9016 * Runs Fourier.cpp script to get Fenton wave solution
9017*/
9018 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6fenton_6Fenton_3runFourier, 0, __pyx_mstate_global->__pyx_n_u_runFourier, NULL, __pyx_mstate_global->__pyx_n_u_fenton_Fenton, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error)
9019 __Pyx_GOTREF(__pyx_t_2);
9020 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
9021 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
9022 #endif
9023 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_runFourier, __pyx_t_2) < (0)) __PYX_ERR(0, 106, __pyx_L1_error)
9024 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9025
9026 /* "fenton/Fenton.pyx":113
9027 * runfourier()
9028 *
9029 * def getBYCoeffs(): # <<<<<<<<<<<<<<
9030 * '''
9031 * Get B and Y coeffs of solution
9032*/
9033 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6fenton_6Fenton_5getBYCoeffs, 0, __pyx_mstate_global->__pyx_n_u_getBYCoeffs, NULL, __pyx_mstate_global->__pyx_n_u_fenton_Fenton, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
9034 __Pyx_GOTREF(__pyx_t_2);
9035 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
9036 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
9037 #endif
9038 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_getBYCoeffs, __pyx_t_2) < (0)) __PYX_ERR(0, 113, __pyx_L1_error)
9039 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9040
9041 /* "fenton/Fenton.pyx":130
9042 * return BCoeffs, YCoeffs
9043 *
9044 * def getWavelength(): # <<<<<<<<<<<<<<
9045 * '''
9046 * Get wavelength/depth (dimensionless)
9047*/
9048 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6fenton_6Fenton_7getWavelength, 0, __pyx_mstate_global->__pyx_n_u_getWavelength, NULL, __pyx_mstate_global->__pyx_n_u_fenton_Fenton, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 130, __pyx_L1_error)
9049 __Pyx_GOTREF(__pyx_t_2);
9050 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
9051 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
9052 #endif
9053 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_getWavelength, __pyx_t_2) < (0)) __PYX_ERR(0, 130, __pyx_L1_error)
9054 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9055
9056 /* "fenton/Fenton.pyx":154
9057 *
9058 *
9059 * def copyFiles(): # <<<<<<<<<<<<<<
9060 * '''
9061 * Copy the files to log directory
9062*/
9063 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6fenton_6Fenton_9copyFiles, 0, __pyx_mstate_global->__pyx_n_u_copyFiles, NULL, __pyx_mstate_global->__pyx_n_u_fenton_Fenton, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 154, __pyx_L1_error)
9064 __Pyx_GOTREF(__pyx_t_2);
9065 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
9066 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
9067 #endif
9068 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_copyFiles, __pyx_t_2) < (0)) __PYX_ERR(0, 154, __pyx_L1_error)
9069 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9070
9071 /* "fenton/Fenton.pyx":166
9072 * copy('Flowfield.res',Profiling.logDir)
9073 *
9074 * def __get_dir(): # <<<<<<<<<<<<<<
9075 * return os.path.dirname(__file__)
9076*/
9077 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6fenton_6Fenton_11__get_dir, 0, __pyx_mstate_global->__pyx_n_u_get_dir, NULL, __pyx_mstate_global->__pyx_n_u_fenton_Fenton, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error)
9078 __Pyx_GOTREF(__pyx_t_2);
9079 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
9080 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
9081 #endif
9082 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_get_dir, __pyx_t_2) < (0)) __PYX_ERR(0, 166, __pyx_L1_error)
9083 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9084
9085 /* "fenton/Fenton.pyx":1
9086 * # cython: language_level=3 # <<<<<<<<<<<<<<
9087 * """
9088 * Scripts for creating Fenton waves.
9089*/
9090 __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
9091 __Pyx_GOTREF(__pyx_t_2);
9092 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_2) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
9093 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9094
9095 /*--- Wrapped vars code ---*/
9096
9097 goto __pyx_L0;
9098 __pyx_L1_error:;
9099 __Pyx_XDECREF(__pyx_t_2);
9100 __Pyx_XDECREF(__pyx_t_4);
9101 if (__pyx_m) {
9102 if (__pyx_mstate->__pyx_d && stringtab_initialized) {
9103 __Pyx_AddTraceback("init fenton.Fenton", __pyx_clineno, __pyx_lineno, __pyx_filename);
9104 }
9105 #if !CYTHON_USE_MODULE_STATE
9106 Py_CLEAR(__pyx_m);
9107 #else
9108 Py_DECREF(__pyx_m);
9109 if (pystate_addmodule_run) {
9110 PyObject *tp, *value, *tb;
9111 __Pyx_PyErr_FetchException(&tp, &value, &tb);
9112 __Pyx_State_RemoveModule(&__pyx_moduledef);
9113 __Pyx_PyErr_RestoreException(tp, value, tb);
9114 }
9115 #endif
9116 } else if (!PyErr_Occurred()) {
9117 PyErr_SetString(PyExc_ImportError, "init fenton.Fenton");
9118 }
9119 __pyx_L0:;
9120 __Pyx_RefNannyFinishContext();
9121 #if CYTHON_PEP489_MULTI_PHASE_INIT
9122 return (__pyx_m != NULL) ? 0 : -1;
9123 #else
9124 return __pyx_m;
9125 #endif
9126}
9127/* #### Code section: pystring_table ### */
9128/* #### Code section: cached_builtins ### */
9129
9130static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) {
9131 int __pyx_lineno = 0;
9132 const char *__pyx_filename = NULL;
9133 int __pyx_clineno = 0;
9134 CYTHON_UNUSED_VAR(__pyx_mstate);
9135 __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_open); if (!__pyx_builtin_open) __PYX_ERR(0, 73, __pyx_L1_error)
9136
9137 /* Cached unbound methods */
9138 __pyx_mstate->__pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type;
9139 __pyx_mstate->__pyx_umethod_PyDict_Type_items.method_name = &__pyx_mstate->__pyx_n_u_items;
9140 __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type;
9141 __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop;
9142 __pyx_mstate->__pyx_umethod_PyDict_Type_values.type = (PyObject*)&PyDict_Type;
9143 __pyx_mstate->__pyx_umethod_PyDict_Type_values.method_name = &__pyx_mstate->__pyx_n_u_values;
9144 return 0;
9145 __pyx_L1_error:;
9146 return -1;
9147}
9148/* #### Code section: cached_constants ### */
9149
9150static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) {
9151 __Pyx_RefNannyDeclarations
9152 int __pyx_lineno = 0;
9153 const char *__pyx_filename = NULL;
9154 int __pyx_clineno = 0;
9155 CYTHON_UNUSED_VAR(__pyx_mstate);
9156 __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
9157
9158 /* "fenton/Fenton.pyx":89
9159 * {ncoeffs}
9160 * {height_steps}
9161 * '''.format(waveheight=waveheight_dimless, mode=mode, length=length_dimless, current_criterion=current_criterion, # <<<<<<<<<<<<<<
9162 * current_magnitude=current_magnitude_dimless, ncoeffs=ncoeffs, height_steps=height_steps))
9163 * # Convergence options file
9164*/
9165 {
9166 PyObject* __pyx_temp[7] = {__pyx_mstate_global->__pyx_n_u_waveheight, __pyx_mstate_global->__pyx_n_u_mode, __pyx_mstate_global->__pyx_n_u_length, __pyx_mstate_global->__pyx_n_u_current_criterion, __pyx_mstate_global->__pyx_n_u_current_magnitude, __pyx_mstate_global->__pyx_n_u_ncoeffs, __pyx_mstate_global->__pyx_n_u_height_steps};
9167 __pyx_mstate_global->__pyx_tuple[0] = __Pyx_PyTuple_FromArray(__pyx_temp, 7); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(0, 89, __pyx_L1_error)
9168 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]);
9169 }
9170 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]);
9171
9172 /* "fenton/Fenton.pyx":73
9173 * mode = 'Period'
9174 * filename = 'Data.dat'
9175 * with open(filename, 'w') as f: # <<<<<<<<<<<<<<
9176 * waveheight_dimless = waveheight/depth
9177 * mode = mode
9178*/
9179 {
9180 PyObject* __pyx_temp[3] = {Py_None, Py_None, Py_None};
9181 __pyx_mstate_global->__pyx_tuple[1] = __Pyx_PyTuple_FromArray(__pyx_temp, 3); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(0, 73, __pyx_L1_error)
9182 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]);
9183 }
9184 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]);
9185
9186 /* "fenton/Fenton.pyx":97
9187 * {niter} Maximum number of iterations for each height step; 10 OK for ordinary waves, 40 for highest
9188 * {conv_crit} Criterion for convergence, typically 1.e-4, or 1.e-5 for highest waves
9189 * '''.format(niter=niter, conv_crit=conv_crit)) # <<<<<<<<<<<<<<
9190 * # Points number file
9191 * filename = 'Points.dat'
9192*/
9193 {
9194 PyObject* __pyx_temp[2] = {__pyx_mstate_global->__pyx_n_u_niter, __pyx_mstate_global->__pyx_n_u_conv_crit};
9195 __pyx_mstate_global->__pyx_tuple[2] = __Pyx_PyTuple_FromArray(__pyx_temp, 2); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(0, 97, __pyx_L1_error)
9196 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]);
9197 }
9198 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]);
9199
9200 /* "fenton/Fenton.pyx":125
9201 * Y coeffs of solution
9202 * '''
9203 * FFT = np.genfromtxt('Solution.res', delimiter=None, comments='#') # <<<<<<<<<<<<<<
9204 * BCoeffs = FFT[:,1]
9205 * YCoeffs = FFT[:,2]
9206*/
9207 {
9208 PyObject* __pyx_temp[2] = {__pyx_mstate_global->__pyx_n_u_delimiter, __pyx_mstate_global->__pyx_n_u_comments};
9209 __pyx_mstate_global->__pyx_tuple[3] = __Pyx_PyTuple_FromArray(__pyx_temp, 2); if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(0, 125, __pyx_L1_error)
9210 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]);
9211 }
9212 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]);
9213
9214 /* "fenton/Fenton.pyx":126
9215 * '''
9216 * FFT = np.genfromtxt('Solution.res', delimiter=None, comments='#')
9217 * BCoeffs = FFT[:,1] # <<<<<<<<<<<<<<
9218 * YCoeffs = FFT[:,2]
9219 * return BCoeffs, YCoeffs
9220*/
9221 __pyx_mstate_global->__pyx_slice[0] = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[0])) __PYX_ERR(0, 126, __pyx_L1_error)
9222 __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]);
9223 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
9224 {
9225 PyObject* __pyx_temp[2] = {__pyx_mstate_global->__pyx_slice[0], __pyx_mstate_global->__pyx_int_1};
9226 __pyx_mstate_global->__pyx_tuple[4] = __Pyx_PyTuple_FromArray(__pyx_temp, 2); if (unlikely(!__pyx_mstate_global->__pyx_tuple[4])) __PYX_ERR(0, 126, __pyx_L1_error)
9227 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[4]);
9228 }
9229 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[4]);
9230
9231 /* "fenton/Fenton.pyx":127
9232 * FFT = np.genfromtxt('Solution.res', delimiter=None, comments='#')
9233 * BCoeffs = FFT[:,1]
9234 * YCoeffs = FFT[:,2] # <<<<<<<<<<<<<<
9235 * return BCoeffs, YCoeffs
9236 *
9237*/
9238 {
9239 PyObject* __pyx_temp[2] = {__pyx_mstate_global->__pyx_slice[0], __pyx_mstate_global->__pyx_int_2};
9240 __pyx_mstate_global->__pyx_tuple[5] = __Pyx_PyTuple_FromArray(__pyx_temp, 2); if (unlikely(!__pyx_mstate_global->__pyx_tuple[5])) __PYX_ERR(0, 127, __pyx_L1_error)
9241 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[5]);
9242 }
9243 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[5]);
9244
9245 /* "fenton/Fenton.pyx":146
9246 * '''
9247 * wavelength = None
9248 * with open('Solution.res', 'r') as f: # <<<<<<<<<<<<<<
9249 * for line in f:
9250 * l = line.split()
9251*/
9252 {
9253 PyObject* __pyx_temp[2] = {__pyx_mstate_global->__pyx_kp_u_Solution_res, __pyx_mstate_global->__pyx_n_u_r};
9254 __pyx_mstate_global->__pyx_tuple[6] = __Pyx_PyTuple_FromArray(__pyx_temp, 2); if (unlikely(!__pyx_mstate_global->__pyx_tuple[6])) __PYX_ERR(0, 146, __pyx_L1_error)
9255 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[6]);
9256 }
9257 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[6]);
9258
9259 /* "fenton/Fenton.pyx":17
9260 * cdef void runfourier()
9261 *
9262 * def writeInput(waveheight, # <<<<<<<<<<<<<<
9263 * depth,
9264 * period=None,
9265*/
9266 {
9267 PyObject* __pyx_temp[13] = {Py_None, Py_None, ((PyObject*)__pyx_mstate_global->__pyx_n_u_Period), ((PyObject*)__pyx_mstate_global->__pyx_int_1), ((PyObject*)__pyx_mstate_global->__pyx_int_0), ((PyObject*)__pyx_mstate_global->__pyx_int_8), ((PyObject*)__pyx_mstate_global->__pyx_int_1), ((PyObject*)__pyx_mstate_global->__pyx_float_9_81), ((PyObject*)__pyx_mstate_global->__pyx_int_40), ((PyObject*)__pyx_mstate_global->__pyx_float_1_eneg_05), ((PyObject*)__pyx_mstate_global->__pyx_int_50), ((PyObject*)__pyx_mstate_global->__pyx_int_16), ((PyObject*)__pyx_mstate_global->__pyx_int_20)};
9268 __pyx_mstate_global->__pyx_tuple[7] = __Pyx_PyTuple_FromArray(__pyx_temp, 13); if (unlikely(!__pyx_mstate_global->__pyx_tuple[7])) __PYX_ERR(0, 17, __pyx_L1_error)
9269 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[7]);
9270 }
9271 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[7]);
9272 #if CYTHON_IMMORTAL_CONSTANTS
9273 {
9274 PyObject **table = __pyx_mstate->__pyx_tuple;
9275 for (Py_ssize_t i=0; i<8; ++i) {
9276 #if PY_VERSION_HEX >= 0x030F0000
9277 PyUnstable_SetImmortal(table[i]);
9278 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
9279 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
9280 #if PY_VERSION_HEX < 0x030E0000
9281 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
9282 #else
9283 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
9284 #endif
9285 {
9286 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
9287 }
9288 #else
9289 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
9290 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
9291 #endif
9292 }
9293 }
9294 #endif
9295 #if CYTHON_IMMORTAL_CONSTANTS
9296 {
9297 PyObject **table = __pyx_mstate->__pyx_slice;
9298 for (Py_ssize_t i=0; i<1; ++i) {
9299 #if PY_VERSION_HEX >= 0x030F0000
9300 PyUnstable_SetImmortal(table[i]);
9301 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
9302 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
9303 #if PY_VERSION_HEX < 0x030E0000
9304 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
9305 #else
9306 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
9307 #endif
9308 {
9309 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
9310 }
9311 #else
9312 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
9313 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
9314 #endif
9315 }
9316 }
9317 #endif
9318 __Pyx_RefNannyFinishContext();
9319 return 0;
9320 __pyx_L1_error:;
9321 __Pyx_RefNannyFinishContext();
9322 return -1;
9323}
9324/* #### Code section: init_constants ### */
9325
9326static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) {
9327 int __pyx_lineno = 0;
9328 const char *__pyx_filename = NULL;
9329 int __pyx_clineno = 0;
9330 CYTHON_UNUSED_VAR(__pyx_mstate);
9331 {
9332 const struct { const unsigned int length: 8; } str_length_index[] = {{1},{1},{1},{242},{15},{8},{13},{48},{10},{12},{11},{99},{39},{34},{25},{7},{3},{6},{9},{4},{10},{7},{20},{12},{17},{9},{8},{8},{8},{9},{8},{10},{8},{12},{8},{13},{18},{10},{18},{8},{9},{4},{9},{17},{17},{25},{9},{5},{7},{1},{13},{8},{6},{1},{10},{11},{13},{12},{5},{1},{6},{14},{4},{6},{4},{7},{5},{2},{5},{4},{2},{4},{6},{18},{15},{15},{3},{7},{1},{10},{10},{6},{5},{4},{10},{6},{1},{10},{18},{10},{5},{10}};
9333 const struct { const unsigned int length: 9; } bytes_length_index[] = {{15},{331},{83},{9},{49},{72}};
9334 #ifndef CYTHON_COMPRESS_STRINGS
9335 #define CYTHON_COMPRESS_STRINGS 90
9336 #endif
9337 #if (CYTHON_COMPRESS_STRINGS) == 1 /* compression: zlib (1077 bytes) */
9338static const char cstring[] = "x\332\215TMo\333F\020\225\020\253\225d;\376\010\222\006(\234\322\215\333\246\255\243D\205\235\"H\201B\266\241&H\322ZMS\327-jb\275\\J[\223\\jwi\2110\014\370\310#\217{\344\221G\035u\314\261G\035u\314O\360O\350,)\333B}\211 r\206\303\267og\336\314\362~\355\307m\346I\316\034\303\246\0161$3\360\344\031\3541\341m\342ab \3172X \375@\032\31468\021\201#E\365\304\243\222\360\323J\3455\352S7p\r/p\017\t\327\020\375\002I\312<a\330\214\033\004\341\216\321!\264\335\221\206\220\304\177f\324\037\033\277\274\314\3361nQ\017\361\320\350\241c\"\326\215\215\307Y\270\003`\"d\365D\347abN\345ie\233k^`\315\020S\t\256\0332\364)F\216\023\032\365\032y\270\261\016\264\231\2679M\226oQ\335\276ZX\263\220\334A\022i\333tX\317\246\304\261jP\340\256\336\307\322,z\215C\274\266\354\030n\000\034\207\304\020Df\264M\342IHF#v\031\365\244\3204o\230\023\350\3125\313\233\200\333\010v\001w\017@\325\023\r\315u8\255\236\270\314\"`rrpp\30090f\305feN\305\\\324\006\265\203l\201\207\031\261m\001^NejI\341\021\344\367\303\232\211\031\0475\027:D\021\347(4l\004\235\265tk\251\3533.\247a\201\213\240\256\377#|\316$\t\304#;\253\357Q^f\315\017\373[\333\331\316\315\346o\271>\273\234\301\330P\257\255\253\333\273\024j?\207\231\346n\330\207k\207bi\376L\372\362Wb\233&\362<&\221$&\374\260\203\2040\333DB\301\256\016\300N\204gN\237Jm\365Tf6\360\260\266\2005-\n\020\027QO\007@\304 \207x\310\315l7@\316\205/\241\353`\250\320\345\302\004S\217 \021z\230\262\332e@\340\016\301G\246\236\036\014\265\020\023\210%\207\266\035\"|\204\231\353BR\342r\n1\363C}5!1q\255c\327\332u-\000\331\273\260RX\304\241\256^e\021_v\240$\235\262\235+^\313\025\327\265gQ\306\241Mm\030X\2333W\366%\210\2605\321\030\334+\335\247\307A+*\234<\236\337/v\3265:\254\275C\271\036\300\3110eG\331\363\263\331`>\361\230\360a2\374\254\313~6\333\246\315\t\034\374l\240\047\021\330\227a\nG\357\342\221K}\010}\346O&\210\363\300k\262\200S\302\341\314X\304F\372\303\321\001\331\035\341;T\212.\227\"8\0044\206\304\216\221\023\020\321\273:#W\336E\356W\207\261\247%\317n/<\370.\235\025\3073\263""\321w\321\333\370\201ZU\365\263\342\373\205\305\361\007\374\317\237\027\013\245\271\350\373\370+u[\341\344\323\364\247\301\223\341\322x\346\343\263^\204\343\333\261\245\276M\366\322\306\270\274\020u\363h;~\253\326\324Qz\3532\252o\225\371\250\025\375\243\312Iq\\^Q\177&\335\264\230\277-\317F\233\361\215\270>\236[Q\277\047\365d+!i=m\244\255\024\215\347\227\343\373qK\277\231,X\033\255m\016Z\203\303ai\330\032\242a\367\035\304*\321\235\250\033\027\317\027\013P\340j\364lt\347\233\364\213\364x\2607\372\341\325\350\325\301\350\300\034\027\226G\313\017\323?\006\373C\367\337\372\373k\371\\0|\2243<\211?Q\325d\365Cqg\305\363r\241T>\013\343\262\272\241\352\343\362\\\324\210\376R\225d)sG\363\237\251P\347\256\303\177\253\257\223\t\302T/\222V\356\036\250\247Ic\002^Q\373\t\002\312j\241\264\020i\347n\2414\033}\036\275\214\273\243\273\017\322\352\340\313a\345\035\350\177\023\324\277\0257\246\234\331\350i\334\200\005\367\n\245\345x)K|t\363\236\352$HS?\007\310\334b<\0237\325\352xn!\352\305X-\253\rH\355FZ\037/\256\250\226B\252\253Y6\343b\274\364\037\242\355\260v";
9339 PyObject *data = __Pyx_DecompressString(cstring, 1077, 1);
9340 #define __Pyx_DecompressString_LZSS_UNUSED
9341 if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
9342 const char* const bytes = __Pyx_PyBytes_AsString(data);
9343 #if !CYTHON_ASSUME_SAFE_MACROS
9344 if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
9345 #endif
9346 #elif (CYTHON_COMPRESS_STRINGS) > 0 && (CYTHON_COMPRESS_STRINGS) <= 90 /* compression: lzss (1350 bytes) */
9347static const char cstring[] = "\377#.?Contr\377ol file \317to c\t\004\005\000ve\377rgence a\377nd outpu\377t of res\377ults\n{ni\377ter}\t\tMa\377ximum nu\317mber\037\001\025\001at\377ions for\377 each he\377ight ste\377p; 10 OK\376\027\002ordinar\377y waves,\327 40.\002h*\000es\367t\n{\204\001_criot}\tC\003\000erS\000\374P\002\226\010, typi\377cally 1.\237e-4, s\000\006\0015\344A\t]\003\n\357\000\322\005.da\337tData\004\001Fl\377owfield.\322\336\000Pd\001\362\000r\222\002le\377ngth mus\377t be set~\322\002Fenton\264\002\277PointsK\001S\347olu\366\001B\001Sur\257faceM\001W\333\000\n\371{\340\001\202#}\n{mo\343de\004\000W\003\r\000cur\341rO\000\350\002\342\002\t\010mag\372\353 u,\002ncoef\023fs?\000\315#_\317!\014\000\374 \377py._core\373.m\237@iarra\257y fa\327@d\327Ai\337mport\033\tum\371a\325\000\022\rprote\257us/f\333\002/\341\003.\337pyxBCu\002FF\335T\232#Pro\264`in\321g\332\001\336\001\243#Y!\003__\367Pyx\001\000Dict\377_NextRef\377__annota\377te____cl\177ass_get\306`\331m\r\001\316 er\004\002xiqt\036\001\222\204\001\003\002unc.\001\356)\000_di \000mai\331n?\001\302 ulH\002na\275mP\002qual\004\005t\254\300`f\000is\222!o\225@n\377easyncio\371.\244 \013\003schec\373k_\272acline\355_V\000tr\264@bac_kcomm\343@s\375f\357copy\000\001Fil\203es\241N\273E\246F\000\016\273\000m~7\000sdelim\274\205\001\237depth\320\000\273\001fb\354#.\323c\216\206\001\021\002or\244@\377ggenfrom\027txt\256 B\335$\271 \356\047\014\203i\316!sl\263\204\003\271\204\003r\005\340\001?logDir\375a\306d\366\306\206\002np\276bopenWosp\227`p\201\205\002p\327\204\002?_frees\313\204\003\013\004\377velocityv\006\006rt\201\206\001pop\273d\377rrunFour\377iersetde\373fa\265\207\001hutil\377splitsqr\357tsub\355`ces\377svaluesw \232\205\007\244\205\007\256%\240\207\001\207\206\003w\210\207\001\000\002\377Input\200\001\330\377\004\013\2102\210U\220(\377\230!\2301\200\001\340\017\303\020\330\000\000\000\003\000\t\n\013\360H\377\001\000\005\014\2107\220\047\377\230\025\230c\240\033\250G\377\2606\270\021\330\004\007\200\377w\210c\220\025\220d""\230\377+\240W\250A\330\010\017\373\210q\020\003g\220U\230$\317\230k\250\023\r\006\027\001\t\r\377\210Q\210j\230\010\240\001\377\330\010\035\230Z\240q\250\375\001.\003\010\013\2105\220\003\377\2201\330\014\035\230V\240\3771\240B\240e\2501\250\377A\250Q\250a\330\r\022\317\220#\220Q\026\001*\004$\320\377$5\260Q\260b\270\005\177\270Q\270a\270q\300K\000\377\t\210\026\210q\220\001\360\373\020\000\336\000!\210;\320\026\377*\250%\250v\260W\320\377<L\320L^\320^_\377\330\000\022\320\022-\250X\377\260Y\270m\3101\340\004\364\200\r:\005\006<\0036\220\027\230\367\n\240!\000%\200\001\360\010\377\000\005\010\200y\220\010\230\377\003\2301\330\010\014\210A\277\210[\230\t\240\021\006\002\320\317\r\037\230y\351\001\023\001]\230\373)\240\033\004_\230I\240Q\276\047\003^\2309\240A&\004\035\357\230Y\240aP\000\n\000\005\373\017\210\005\001\030\000\005\013\210\377\"\210K\220q\320\030(\177\250\n\260&\270\t\300\375 }\016\373 \023\220A\330\004\000\006\337\013\2109\220A\212\000\036\000\337\005\022\220\021\330\355!\320\016_\036\230h\240a\217\001H)\000\377\014\020\220\004\220F\230!\377\330\014\017\210w\220c\230\367\022\2304\230\000\003\2501\330\177\020\035\230Q\230a\230\277@\016\212A\001\220\021";
9348 PyObject *data = __Pyx_DecompressString_LZSS(cstring, 1350, 1784);
9349 #define __Pyx_DecompressString_UNUSED
9350 if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
9351 const char* const bytes = __Pyx_PyBytes_AsString(data);
9352 #if !CYTHON_ASSUME_SAFE_MACROS
9353 if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
9354 #endif
9355 #else /* compression: none (1784 bytes) */
9356static const char bytes[] = "#.?Control file to control convergence and output of results\n{niter}\t\tMaximum number of iterations for each height step; 10 OK for ordinary waves, 40 for highest\n{conv_crit}\tCriterion for convergence, typically 1.e-4, or 1.e-5 for highest waves\nConvergence.datData.datFlowfield.resPeriod or wavelength must be set for Fenton wavePoints.datSolution.resSurface.resWave\n{waveheight}\n{mode}\n{length}\n{current_criterion}\n{current_magnitude}\n{ncoeffs}\n{height_steps}\nnumpy._core.multiarray failed to importnumpy._core.umath failed to importproteus/fenton/Fenton.pyxBCoeffsFFTPeriodProfilingWaveWavelengthYCoeffs__Pyx_PyDict_NextRef__annotate____class_getitem____enter____exit____file____func____get_dir__main____module____name____qualname____test___is_coroutineasyncio.coroutinescheck_callcline_in_tracebackcommentsconv_critcopycopyFilescurrent_criterioncurrent_magnitudecurrent_magnitude_dimlessdelimiterdepthdirnameffenton.FentonfilenameformatggenfromtxtgetBYCoeffsgetWavelengthheight_stepsitemsllengthlength_dimlesslinelogDirmodencoeffsniternpnumpyopenospathperiodpoints_freesurfacepoints_velocitypoints_verticalpopproteusrrunFouriersetdefaultshutilsplitsqrtsubprocessvalueswwaveheightwaveheight_dimlesswavelengthwritewriteInput\200\001\330\004\013\2102\210U\220(\230!\2301\200\001\340\017\020\330\017\020\330\017\020\330\017\020\330\017\020\330\017\020\330\017\020\330\017\020\330\017\020\330\017\020\330\017\020\330\017\020\330\017\020\360H\001\000\005\014\2107\220\047\230\025\230c\240\033\250G\2606\270\021\330\004\007\200w\210c\220\025\220d\230+\240W\250A\330\010\017\210q\330\004\007\200w\210g\220U\230$\230k\250\023\250A\330\010\017\210q\330\004\017\210q\330\t\r\210Q\210j\230\010\240\001\330\010\035\230Z\240q\250\001\330\010\017\210q\330\010\013\2105\220\003\2201\330\014\035\230V\2401\240B\240e\2501\250A\250Q\250a\330\r\022\220#\220Q\330\014\035\230Z\240q\250\001\330\010$\320$5\260Q\260b\270\005\270Q\270a\270q\300\001\330\010\t\210\026\210q\220\001\360\020\000\004\013\210!""\210;\320\026*\250%\250v\260W\320<L\320L^\320^_\330\000\022\320\022-\250X\260Y\270m\3101\340\004\017\210q\330\t\r\210Q\210j\230\010\240\001\330\010\t\210\026\210q\220\001\360\006\000\004\013\210!\2106\220\027\230\n\240!\340\004\017\210q\330\t\r\210Q\210j\230\010\240\001\330\010\t\210\026\210q\220\001\360\006\000\004\013\210!\2106\220\027\230\n\240!\200\001\360\010\000\005\010\200y\220\010\230\003\2301\330\010\014\210A\210[\230\t\240\021\330\010\014\210A\320\r\037\230y\250\001\330\010\014\210A\210]\230)\2401\330\010\014\210A\210_\230I\240Q\330\010\014\210A\210^\2309\240A\330\010\014\210A\320\r\035\230Y\240a\200\001\360\n\000\005\017\210a\200\001\360\030\000\005\013\210\"\210K\220q\320\030(\250\n\260&\270\t\300\021\330\004\016\210c\220\023\220A\330\004\016\210c\220\023\220A\330\004\013\2109\220A\200\001\360\036\000\005\022\220\021\330\t\r\210Q\320\016\036\230h\240a\330\010\014\210H\220A\330\014\020\220\004\220F\230!\330\014\017\210w\220c\230\022\2304\230y\250\003\2501\330\020\035\230Q\230a\230q\330\004\013\2105\220\001\220\021";
9357 PyObject *data = NULL;
9358 #define __Pyx_DecompressString_UNUSED
9359 #define __Pyx_DecompressString_LZSS_UNUSED
9360 #endif
9361 PyObject **stringtab = __pyx_mstate->__pyx_string_tab;
9362 Py_ssize_t pos = 0;
9363 for (int i = 0; i < 92; i++) {
9364 Py_ssize_t bytes_length = str_length_index[i].length;
9365 PyObject *string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL);
9366 if (likely(string) && i >= 15) PyUnicode_InternInPlace(&string);
9367 if (unlikely(!string)) {
9368 Py_XDECREF(data);
9369 __PYX_ERR(0, 1, __pyx_L1_error)
9370 }
9371 stringtab[i] = string;
9372 pos += bytes_length;
9373 }
9374 for (int i = 92; i < 98; i++) {
9375 Py_ssize_t bytes_length = bytes_length_index[i-92].length;
9376 PyObject *string = PyBytes_FromStringAndSize(bytes + pos, bytes_length);
9377 stringtab[i] = string;
9378 pos += bytes_length;
9379 if (unlikely(!string)) {
9380 Py_XDECREF(data);
9381 __PYX_ERR(0, 1, __pyx_L1_error)
9382 }
9383 }
9384 Py_XDECREF(data);
9385 for (Py_ssize_t i = 0; i < 98; i++) {
9386 if (unlikely(PyObject_Hash(stringtab[i]) == -1)) {
9387 __PYX_ERR(0, 1, __pyx_L1_error)
9388 }
9389 }
9390 #if CYTHON_IMMORTAL_CONSTANTS
9391 {
9392 PyObject **table = stringtab + 92;
9393 for (Py_ssize_t i=0; i<6; ++i) {
9394 #if PY_VERSION_HEX >= 0x030F0000
9395 PyUnstable_SetImmortal(table[i]);
9396 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
9397 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
9398 #if PY_VERSION_HEX < 0x030E0000
9399 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
9400 #else
9401 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
9402 #endif
9403 {
9404 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
9405 }
9406 #else
9407 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
9408 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
9409 #endif
9410 }
9411 }
9412 #endif
9413 }
9414 {
9415 PyObject **numbertab = __pyx_mstate->__pyx_number_tab;
9416 double const c_constants[] = {9.81,1.e-05};
9417 for (int i = 0; i < 2; i++) {
9418 numbertab[i] = PyFloat_FromDouble(c_constants[i]);
9419 if (unlikely(!numbertab[i])) __PYX_ERR(0, 1, __pyx_L1_error)
9420 }
9421 }
9422 {
9423 PyObject **numbertab = __pyx_mstate->__pyx_number_tab + 2;
9424 int8_t const cint_constants_1[] = {0,1,2,8,16,20,40,50};
9425 for (int i = 0; i < 8; i++) {
9426 numbertab[i] = PyLong_FromLong(cint_constants_1[i - 0]);
9427 if (unlikely(!numbertab[i])) __PYX_ERR(0, 1, __pyx_L1_error)
9428 }
9429 }
9430 #if CYTHON_IMMORTAL_CONSTANTS
9431 {
9432 PyObject **table = __pyx_mstate->__pyx_number_tab;
9433 for (Py_ssize_t i=0; i<10; ++i) {
9434 #if PY_VERSION_HEX >= 0x030F0000
9435 PyUnstable_SetImmortal(table[i]);
9436 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
9437 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
9438 #if PY_VERSION_HEX < 0x030E0000
9439 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
9440 #else
9441 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
9442 #endif
9443 {
9444 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
9445 }
9446 #else
9447 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
9448 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
9449 #endif
9450 }
9451 }
9452 #endif
9453 return 0;
9454 __pyx_L1_error:;
9455 return -1;
9456}
9457/* #### Code section: init_codeobjects ### */
9458#ifdef __cplusplus
9459namespace {
9460#endif
9461typedef struct {
9462 unsigned int argcount : 4;
9463 unsigned int num_posonly_args : 1;
9464 unsigned int num_kwonly_args : 1;
9465 unsigned int nlocals : 5;
9466 unsigned int flags : 10;
9467 unsigned int first_line : 8;
9468} __Pyx_PyCode_New_function_description;
9469#ifdef __cplusplus
9470} /* anonymous namespace */
9471#endif
9472/* NewCodeObj.proto */
9473static PyObject* __Pyx_PyCode_New(
9474 const __Pyx_PyCode_New_function_description descr,
9475 PyObject * const *varnames,
9476 PyObject *filename,
9477 PyObject *funcname,
9478 PyObject *line_table,
9479 PyObject *tuple_dedup_map
9480);
9481
9482
9483static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) {
9484 PyObject* tuple_dedup_map = PyDict_New();
9485 if (unlikely(!tuple_dedup_map)) return -1;
9486 {
9487 const __Pyx_PyCode_New_function_description descr = {15, 0, 0, 20, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 17};
9488 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_waveheight, __pyx_mstate->__pyx_n_u_depth, __pyx_mstate->__pyx_n_u_period, __pyx_mstate->__pyx_n_u_wavelength, __pyx_mstate->__pyx_n_u_mode, __pyx_mstate->__pyx_n_u_current_criterion, __pyx_mstate->__pyx_n_u_current_magnitude, __pyx_mstate->__pyx_n_u_ncoeffs, __pyx_mstate->__pyx_n_u_height_steps, __pyx_mstate->__pyx_n_u_g, __pyx_mstate->__pyx_n_u_niter, __pyx_mstate->__pyx_n_u_conv_crit, __pyx_mstate->__pyx_n_u_points_freesurface, __pyx_mstate->__pyx_n_u_points_velocity, __pyx_mstate->__pyx_n_u_points_vertical, __pyx_mstate->__pyx_n_u_filename, __pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_waveheight_dimless, __pyx_mstate->__pyx_n_u_length_dimless, __pyx_mstate->__pyx_n_u_current_magnitude_dimless};
9489 __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_fenton_Fenton_pyx, __pyx_mstate->__pyx_n_u_writeInput, __pyx_mstate->__pyx_kp_b_iso88591_H_7_c_G6_wc_d_WA_q_wgU_k_A_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad;
9490 }
9491 {
9492 const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 0, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 106};
9493 PyObject* const varnames[] = {0};
9494 __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_fenton_Fenton_pyx, __pyx_mstate->__pyx_n_u_runFourier, __pyx_mstate->__pyx_kp_b_iso88591_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad;
9495 }
9496 {
9497 const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 113};
9498 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_FFT, __pyx_mstate->__pyx_n_u_BCoeffs, __pyx_mstate->__pyx_n_u_YCoeffs};
9499 __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_fenton_Fenton_pyx, __pyx_mstate->__pyx_n_u_getBYCoeffs, __pyx_mstate->__pyx_kp_b_iso88591_Kq_c_A_c_A_9A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad;
9500 }
9501 {
9502 const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 130};
9503 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_wavelength, __pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_line, __pyx_mstate->__pyx_n_u_l};
9504 __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_fenton_Fenton_pyx, __pyx_mstate->__pyx_n_u_getWavelength, __pyx_mstate->__pyx_kp_b_iso88591_Q_ha_HA_F_wc_4y_1_Qaq_5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad;
9505 }
9506 {
9507 const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 0, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 154};
9508 PyObject* const varnames[] = {0};
9509 __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_fenton_Fenton_pyx, __pyx_mstate->__pyx_n_u_copyFiles, __pyx_mstate->__pyx_kp_b_iso88591_y_1_A_A_y_A_1_A_IQ_A_9A_A_Ya, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad;
9510 }
9511 {
9512 const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 0, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 166};
9513 PyObject* const varnames[] = {0};
9514 __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_fenton_Fenton_pyx, __pyx_mstate->__pyx_n_u_get_dir, __pyx_mstate->__pyx_kp_b_iso88591_2U_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad;
9515 }
9516 Py_DECREF(tuple_dedup_map);
9517 return 0;
9518 bad:
9519 Py_DECREF(tuple_dedup_map);
9520 return -1;
9521}
9522/* #### Code section: init_globals ### */
9523
9524static int __Pyx_InitGlobals(void) {
9525 int __pyx_lineno = 0;
9526 const char *__pyx_filename = NULL;
9527 int __pyx_clineno = 0;
9528 /* PythonCompatibility.init */
9529 if (likely(__Pyx_init_co_variables() == 0 && __Pyx_init_tpflags_variables() == 0)); else
9530
9531 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
9532
9533 /* AssertionsEnabled.init */
9534 if (likely(__Pyx_init_assertions_enabled() == 0)); else
9535
9536 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
9537
9538 /* PyFrozenDict.init */
9539 #if CYTHON_COMPILING_IN_LIMITED_API
9540 {
9541 PyObject *builtins = PyEval_GetBuiltins(); // borrowed
9542 if (likely(builtins)) {
9543 PyObject *type_name = PyUnicode_FromStringAndSize("frozendict", sizeof("frozendict")-1);
9544 if (likely(type_name)) {
9545 PyObject *frozendict_type = PyObject_GetItem(builtins, type_name);
9546 Py_DECREF(type_name);
9547 if (!frozendict_type && PyErr_ExceptionMatches(PyExc_KeyError)) {
9548 PyErr_Clear();
9549 frozendict_type = (PyObject*) &PyDict_Type;
9550 Py_INCREF(frozendict_type);
9551 }
9552 __pyx_mstate_global->__Pyx_PyFrozenDictType = frozendict_type;
9553 }
9554 }
9555 } // error handling follows
9556 #endif
9557
9558 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
9559
9560 /* NumpyImportArray.init */
9561 /*
9562 * Cython has automatically inserted a call to _import_array since
9563 * you didn't include one when you cimported numpy. To disable this
9564 * add the line
9565 * <void>numpy._import_array
9566 */
9567 #ifdef NPY_FEATURE_VERSION
9568 #ifndef NO_IMPORT_ARRAY
9569 if (unlikely(_import_array() == -1)) {
9570 PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import "
9571 "(auto-generated because you didn't call 'numpy.import_array()' after cimporting numpy; "
9572 "use '<void>numpy._import_array' to disable if you are certain you don't need it).");
9573 }
9574 #endif
9575 #endif
9576
9577 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
9578
9579 /* CommonTypesMetaclass.init */
9580 if (likely(__pyx_CommonTypesMetaclass_init(__pyx_m) == 0)); else
9581
9582 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
9583
9584 /* CachedMethodType.init */
9585 #if CYTHON_COMPILING_IN_LIMITED_API
9586 {
9587 PyObject *typesModule=NULL;
9588 typesModule = PyImport_ImportModule("types");
9589 if (typesModule) {
9590 __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType");
9591 Py_DECREF(typesModule);
9592 }
9593 } // error handling follows
9594 #endif
9595
9596 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
9597
9598 return 0;
9599 __pyx_L1_error:;
9600 return -1;
9601}
9602/* #### Code section: init_after_shared_utility ### */
9603
9604static int __Pyx_InitAfterSharedUtility(void) {
9605 int __pyx_lineno = 0;
9606 const char *__pyx_filename = NULL;
9607 int __pyx_clineno = 0;
9608 /* CythonFunctionPerModule.init */
9609 if (likely(__pyx_CyFunction_init(__pyx_m) == 0)); else
9610
9611 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
9612
9613 return 0;
9614 __pyx_L1_error:;
9615 return -1;
9616}
9617/* #### Code section: cleanup_globals ### */
9618/* #### Code section: cleanup_module ### */
9619/* #### Code section: main_method ### */
9620/* #### Code section: utility_code_pragmas ### */
9621#ifdef _MSC_VER
9622#pragma warning( push )
9623/* Warning 4127: conditional expression is constant
9624 * Cython uses constant conditional expressions to allow in inline functions to be optimized at
9625 * compile-time, so this warning is not useful
9626 */
9627#pragma warning( disable : 4127 )
9628#endif
9629
9630
9631
9632/* #### Code section: utility_code_def ### */
9633
9634/* --- Runtime support code --- */
9635/* Refnanny */
9636#if CYTHON_REFNANNY
9637static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
9638 PyObject *m = NULL, *p = NULL;
9639 void *r = NULL;
9640 m = PyImport_ImportModule(modname);
9641 if (!m) goto end;
9642 p = PyObject_GetAttrString(m, "RefNannyAPI");
9643 if (!p) goto end;
9644 r = PyLong_AsVoidPtr(p);
9645end:
9646 Py_XDECREF(p);
9647 Py_XDECREF(m);
9648 return (__Pyx_RefNannyAPIStruct *)r;
9649}
9650#endif
9651
9652/* FastTypeChecks (used by GivenExceptionMatches) */
9653#if CYTHON_COMPILING_IN_CPYTHON
9654static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
9655 while (a) {
9656 a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
9657 if (a == b)
9658 return 1;
9659 }
9660 return b == &PyBaseObject_Type;
9661}
9662static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
9663 PyObject *mro;
9664 if (a == b) return 1;
9665 mro = a->tp_mro;
9666 if (likely(mro)) {
9667 Py_ssize_t i, n;
9668 n = PyTuple_GET_SIZE(mro);
9669 for (i = 0; i < n; i++) {
9670 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
9671 return 1;
9672 }
9673 return 0;
9674 }
9675 return __Pyx_InBases(a, b);
9676}
9677static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
9678 PyObject *mro;
9679 if (cls == a || cls == b) return 1;
9680 mro = cls->tp_mro;
9681 if (likely(mro)) {
9682 Py_ssize_t i, n;
9683 n = PyTuple_GET_SIZE(mro);
9684 for (i = 0; i < n; i++) {
9685 PyObject *base = PyTuple_GET_ITEM(mro, i);
9686 if (base == (PyObject *)a || base == (PyObject *)b)
9687 return 1;
9688 }
9689 return 0;
9690 }
9691 return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
9692}
9693#endif
9694
9695/* PyErrFetchRestore (used by GivenExceptionMatches) */
9696#if CYTHON_FAST_THREAD_STATE
9697static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
9698#if PY_VERSION_HEX >= 0x030C00A6
9699 PyObject *tmp_value;
9700 assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
9701 if (value) {
9702 #if CYTHON_COMPILING_IN_CPYTHON
9703 if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
9704 #endif
9705 PyException_SetTraceback(value, tb);
9706 }
9707 tmp_value = tstate->current_exception;
9708 tstate->current_exception = value;
9709 Py_XDECREF(tmp_value);
9710 Py_XDECREF(type);
9711 Py_XDECREF(tb);
9712#else
9713 PyObject *tmp_type, *tmp_value, *tmp_tb;
9714 tmp_type = tstate->curexc_type;
9715 tmp_value = tstate->curexc_value;
9716 tmp_tb = tstate->curexc_traceback;
9717 tstate->curexc_type = type;
9718 tstate->curexc_value = value;
9719 tstate->curexc_traceback = tb;
9720 Py_XDECREF(tmp_type);
9721 Py_XDECREF(tmp_value);
9722 Py_XDECREF(tmp_tb);
9723#endif
9724}
9725static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
9726#if PY_VERSION_HEX >= 0x030C00A6
9727 PyObject* exc_value;
9728 exc_value = tstate->current_exception;
9729 tstate->current_exception = 0;
9730 *value = exc_value;
9731 *type = NULL;
9732 *tb = NULL;
9733 if (exc_value) {
9734 *type = (PyObject*) Py_TYPE(exc_value);
9735 Py_INCREF(*type);
9736 #if CYTHON_COMPILING_IN_CPYTHON
9737 *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
9738 Py_XINCREF(*tb);
9739 #else
9740 *tb = PyException_GetTraceback(exc_value);
9741 #endif
9742 }
9743#else
9744 *type = tstate->curexc_type;
9745 *value = tstate->curexc_value;
9746 *tb = tstate->curexc_traceback;
9747 tstate->curexc_type = 0;
9748 tstate->curexc_value = 0;
9749 tstate->curexc_traceback = 0;
9750#endif
9751}
9752#endif
9753
9754/* GivenExceptionMatches (used by PyErrExceptionMatches) */
9755#if CYTHON_COMPILING_IN_CPYTHON
9756static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
9757 if (exc_type1) {
9758 return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
9759 } else {
9760 return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
9761 }
9762}
9763static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
9764 Py_ssize_t i, n;
9765 assert(PyExceptionClass_Check(exc_type));
9766 n = PyTuple_GET_SIZE(tuple);
9767 for (i=0; i<n; i++) {
9768 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
9769 }
9770 for (i=0; i<n; i++) {
9771 PyObject *t = PyTuple_GET_ITEM(tuple, i);
9772 if (likely(PyExceptionClass_Check(t))) {
9773 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
9774 } else {
9775 }
9776 }
9777 return 0;
9778}
9779static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
9780 if (likely(err == exc_type)) return 1;
9781 if (likely(PyExceptionClass_Check(err))) {
9782 if (likely(PyExceptionClass_Check(exc_type))) {
9783 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
9784 } else if (likely(PyTuple_Check(exc_type))) {
9785 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
9786 } else {
9787 }
9788 }
9789 return PyErr_GivenExceptionMatches(err, exc_type);
9790}
9791static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
9792 assert(PyExceptionClass_Check(exc_type1));
9793 assert(PyExceptionClass_Check(exc_type2));
9794 if (likely(err == exc_type1 || err == exc_type2)) return 1;
9795 if (likely(PyExceptionClass_Check(err))) {
9796 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
9797 }
9798 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
9799}
9800#endif
9801
9802/* PyErrExceptionMatches (used by PyObjectGetAttrStrNoError) */
9803#if CYTHON_FAST_THREAD_STATE
9804static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
9805 Py_ssize_t i, n;
9806 n = PyTuple_GET_SIZE(tuple);
9807 for (i=0; i<n; i++) {
9808 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
9809 }
9810 for (i=0; i<n; i++) {
9811 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
9812 }
9813 return 0;
9814}
9815static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
9816 int result;
9817 PyObject *exc_type;
9818#if PY_VERSION_HEX >= 0x030C00A6
9819 PyObject *current_exception = tstate->current_exception;
9820 if (unlikely(!current_exception)) return 0;
9821 exc_type = (PyObject*) Py_TYPE(current_exception);
9822 if (exc_type == err) return 1;
9823#else
9824 exc_type = tstate->curexc_type;
9825 if (exc_type == err) return 1;
9826 if (unlikely(!exc_type)) return 0;
9827#endif
9828 #if CYTHON_AVOID_BORROWED_REFS
9829 Py_INCREF(exc_type);
9830 #endif
9831 if (unlikely(PyTuple_Check(err))) {
9832 result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
9833 } else {
9834 result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
9835 }
9836 #if CYTHON_AVOID_BORROWED_REFS
9837 Py_DECREF(exc_type);
9838 #endif
9839 return result;
9840}
9841#endif
9842
9843/* PyObjectGetAttrStr (used by PyObjectGetAttrStrNoError) */
9844#if CYTHON_USE_TYPE_SLOTS
9845static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
9846 PyTypeObject* tp = Py_TYPE(obj);
9847 if (likely(tp->tp_getattro))
9848 return tp->tp_getattro(obj, attr_name);
9849 return PyObject_GetAttr(obj, attr_name);
9850}
9851#endif
9852
9853/* PyObjectGetAttrStrNoError (used by GetBuiltinName) */
9854#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
9855static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
9856 __Pyx_PyThreadState_declare
9857 __Pyx_PyThreadState_assign
9858 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
9859 __Pyx_PyErr_Clear();
9860}
9861#endif
9862static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
9863 PyObject *result;
9864#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
9865 (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
9866 return result;
9867#else
9868#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS
9869 PyTypeObject* tp = Py_TYPE(obj);
9870 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
9871 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
9872 }
9873#endif
9874 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
9875 if (unlikely(!result)) {
9876 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
9877 }
9878 return result;
9879#endif
9880}
9881
9882/* GetBuiltinName */
9883static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
9884 PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name);
9885 if (unlikely(!result) && !PyErr_Occurred()) {
9886 PyErr_Format(PyExc_NameError,
9887 "name '%U' is not defined", name);
9888 }
9889 return result;
9890}
9891
9892/* GetTopmostException (used by SaveResetException) */
9893#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
9894static _PyErr_StackItem *
9895__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
9896{
9897 _PyErr_StackItem *exc_info = tstate->exc_info;
9898 while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
9899 exc_info->previous_item != NULL)
9900 {
9901 exc_info = exc_info->previous_item;
9902 }
9903 return exc_info;
9904}
9905#endif
9906
9907/* SaveResetException */
9908#if CYTHON_FAST_THREAD_STATE
9909static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
9910 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
9911 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
9912 PyObject *exc_value = exc_info->exc_value;
9913 if (exc_value == NULL || exc_value == Py_None) {
9914 *value = NULL;
9915 *type = NULL;
9916 *tb = NULL;
9917 } else {
9918 *value = exc_value;
9919 Py_INCREF(*value);
9920 *type = (PyObject*) Py_TYPE(exc_value);
9921 Py_INCREF(*type);
9922 *tb = PyException_GetTraceback(exc_value);
9923 }
9924 #elif CYTHON_USE_EXC_INFO_STACK
9925 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
9926 *type = exc_info->exc_type;
9927 *value = exc_info->exc_value;
9928 *tb = exc_info->exc_traceback;
9929 Py_XINCREF(*type);
9930 Py_XINCREF(*value);
9931 Py_XINCREF(*tb);
9932 #else
9933 *type = tstate->exc_type;
9934 *value = tstate->exc_value;
9935 *tb = tstate->exc_traceback;
9936 Py_XINCREF(*type);
9937 Py_XINCREF(*value);
9938 Py_XINCREF(*tb);
9939 #endif
9940}
9941static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
9942 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
9943 _PyErr_StackItem *exc_info = tstate->exc_info;
9944 PyObject *tmp_value = exc_info->exc_value;
9945 exc_info->exc_value = value;
9946 Py_XDECREF(tmp_value);
9947 Py_XDECREF(type);
9948 Py_XDECREF(tb);
9949 #else
9950 PyObject *tmp_type, *tmp_value, *tmp_tb;
9951 #if CYTHON_USE_EXC_INFO_STACK
9952 _PyErr_StackItem *exc_info = tstate->exc_info;
9953 tmp_type = exc_info->exc_type;
9954 tmp_value = exc_info->exc_value;
9955 tmp_tb = exc_info->exc_traceback;
9956 exc_info->exc_type = type;
9957 exc_info->exc_value = value;
9958 exc_info->exc_traceback = tb;
9959 #else
9960 tmp_type = tstate->exc_type;
9961 tmp_value = tstate->exc_value;
9962 tmp_tb = tstate->exc_traceback;
9963 tstate->exc_type = type;
9964 tstate->exc_value = value;
9965 tstate->exc_traceback = tb;
9966 #endif
9967 Py_XDECREF(tmp_type);
9968 Py_XDECREF(tmp_value);
9969 Py_XDECREF(tmp_tb);
9970 #endif
9971}
9972#endif
9973
9974/* GetException */
9975#if CYTHON_FAST_THREAD_STATE
9976static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
9977#else
9978static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
9979#endif
9980{
9981 PyObject *local_type = NULL, *local_value, *local_tb = NULL;
9982#if CYTHON_FAST_THREAD_STATE
9983 PyObject *tmp_type, *tmp_value, *tmp_tb;
9984 #if PY_VERSION_HEX >= 0x030C0000
9985 local_value = tstate->current_exception;
9986 tstate->current_exception = 0;
9987 #else
9988 local_type = tstate->curexc_type;
9989 local_value = tstate->curexc_value;
9990 local_tb = tstate->curexc_traceback;
9991 tstate->curexc_type = 0;
9992 tstate->curexc_value = 0;
9993 tstate->curexc_traceback = 0;
9994 #endif
9995#elif __PYX_LIMITED_VERSION_HEX >= 0x030C0000
9996 local_value = PyErr_GetRaisedException();
9997#else
9998 PyErr_Fetch(&local_type, &local_value, &local_tb);
9999#endif
10000#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
10001 if (likely(local_value)) {
10002 local_type = (PyObject*) Py_TYPE(local_value);
10003 Py_INCREF(local_type);
10004 local_tb = PyException_GetTraceback(local_value);
10005 }
10006#else
10007 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
10008#if CYTHON_FAST_THREAD_STATE
10009 if (unlikely(tstate->curexc_type))
10010#else
10011 if (unlikely(PyErr_Occurred()))
10012#endif
10013 goto bad;
10014 if (local_tb) {
10015 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
10016 goto bad;
10017 }
10018#endif // __PYX_LIMITED_VERSION_HEX >= 0x030C0000
10019 Py_XINCREF(local_tb);
10020 Py_XINCREF(local_type);
10021 Py_XINCREF(local_value);
10022 *type = local_type;
10023 *value = local_value;
10024 *tb = local_tb;
10025#if CYTHON_FAST_THREAD_STATE
10026 #if CYTHON_USE_EXC_INFO_STACK
10027 {
10028 _PyErr_StackItem *exc_info = tstate->exc_info;
10029 #if PY_VERSION_HEX >= 0x030B00a4
10030 tmp_value = exc_info->exc_value;
10031 exc_info->exc_value = local_value;
10032 tmp_type = NULL;
10033 tmp_tb = NULL;
10034 Py_XDECREF(local_type);
10035 Py_XDECREF(local_tb);
10036 #else
10037 tmp_type = exc_info->exc_type;
10038 tmp_value = exc_info->exc_value;
10039 tmp_tb = exc_info->exc_traceback;
10040 exc_info->exc_type = local_type;
10041 exc_info->exc_value = local_value;
10042 exc_info->exc_traceback = local_tb;
10043 #endif
10044 }
10045 #else
10046 tmp_type = tstate->exc_type;
10047 tmp_value = tstate->exc_value;
10048 tmp_tb = tstate->exc_traceback;
10049 tstate->exc_type = local_type;
10050 tstate->exc_value = local_value;
10051 tstate->exc_traceback = local_tb;
10052 #endif
10053 Py_XDECREF(tmp_type);
10054 Py_XDECREF(tmp_value);
10055 Py_XDECREF(tmp_tb);
10056#elif __PYX_LIMITED_VERSION_HEX >= 0x030b0000
10057 PyErr_SetHandledException(local_value);
10058 Py_XDECREF(local_value);
10059 Py_XDECREF(local_type);
10060 Py_XDECREF(local_tb);
10061#else
10062 PyErr_SetExcInfo(local_type, local_value, local_tb);
10063#endif
10064 return 0;
10065#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
10066bad:
10067 *type = 0;
10068 *value = 0;
10069 *tb = 0;
10070 Py_XDECREF(local_type);
10071 Py_XDECREF(local_value);
10072 Py_XDECREF(local_tb);
10073 return -1;
10074#endif
10075}
10076
10077/* PyObjectCall (used by PyObjectFastCall) */
10078#if CYTHON_COMPILING_IN_CPYTHON
10079static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
10080 PyObject *result;
10081 ternaryfunc call = Py_TYPE(func)->tp_call;
10082 if (unlikely(!call))
10083 return PyObject_Call(func, arg, kw);
10084 if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
10085 return NULL;
10086 result = (*call)(func, arg, kw);
10087 Py_LeaveRecursiveCall();
10088 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
10089 PyErr_SetString(
10090 PyExc_SystemError,
10091 "NULL result without error in PyObject_Call");
10092 }
10093 return result;
10094}
10095#endif
10096
10097/* PyObjectCallMethO (used by PyObjectFastCall) */
10098#if CYTHON_COMPILING_IN_CPYTHON
10099static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
10100 PyObject *self, *result;
10101 PyCFunction cfunc;
10102 cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
10103 self = __Pyx_CyOrPyCFunction_GET_SELF(func);
10104 if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
10105 return NULL;
10106 result = cfunc(self, arg);
10107 Py_LeaveRecursiveCall();
10108 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
10109 PyErr_SetString(
10110 PyExc_SystemError,
10111 "NULL result without error in PyObject_Call");
10112 }
10113 return result;
10114}
10115#endif
10116
10117/* PyObjectFastCall */
10118#if CYTHON_COMPILING_IN_LIMITED_API
10119static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs) {
10120 PyObject *argstuple;
10121 PyObject *result = 0;
10122 size_t i;
10123 argstuple = PyTuple_New((Py_ssize_t)nargs);
10124 if (unlikely(!argstuple)) return NULL;
10125 for (i = 0; i < nargs; i++) {
10126 Py_INCREF(args[i]);
10127 if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0)) goto bad;
10128 }
10129 result = __Pyx_PyObject_Call(func, argstuple, kwargs);
10130 bad:
10131 Py_DECREF(argstuple);
10132 return result;
10133}
10134#endif
10135#if CYTHON_VECTORCALL && !(CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY)
10136 #if CYTHON_COMPILING_IN_CPYTHON
10137static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) {
10138 PyTypeObject *tp = Py_TYPE(callable);
10139 #if defined(__Pyx_CyFunction_USED)
10140 if (__Pyx_CyFunction_CheckExact(callable)) {
10141 return __Pyx_CyFunction_func_vectorcall(callable);
10142 }
10143 #endif
10144 if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) {
10145 return NULL;
10146 }
10147 assert(PyCallable_Check(callable));
10148 Py_ssize_t offset = tp->tp_vectorcall_offset;
10149 assert(offset > 0);
10150 vectorcallfunc ptr;
10151 memcpy(&ptr, (char *) callable + offset, sizeof(ptr));
10152 return ptr;
10153}
10154 #else
10155 #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable)
10156 #endif
10157#endif
10158static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwargs) {
10159 Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(nargsf);
10160#if CYTHON_COMPILING_IN_CPYTHON
10161 if (nargs == 0 && kwargs == NULL) {
10162 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
10163 return __Pyx_PyObject_CallMethO(func, NULL);
10164 }
10165 else if (nargs == 1 && kwargs == NULL) {
10166 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
10167 return __Pyx_PyObject_CallMethO(func, args[0]);
10168 }
10169#endif
10170 if (kwargs == NULL) {
10171 #if CYTHON_VECTORCALL
10172 #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
10173 return PyObject_Vectorcall(func, args, nargsf, NULL);
10174 #else
10175 vectorcallfunc f = __Pyx_PyVectorcall_Function(func);
10176 if (f) {
10177 return f(func, args, nargsf, NULL);
10178 }
10179 #endif
10180 #endif
10181 }
10182 if (nargs == 0) {
10183 return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs);
10184 }
10185 #if CYTHON_COMPILING_IN_LIMITED_API
10186 return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
10187 #elif CYTHON_COMPILING_IN_PYPY
10188 return PyObject_VectorcallDict(func, args, (size_t) nargs, kwargs);
10189 #else
10190 return PyObject_VectorcallDict(func, args, nargsf, kwargs);
10191 #endif
10192}
10193
10194/* RaiseException */
10195static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
10196 PyObject* owned_instance = NULL;
10197 if (tb == Py_None) {
10198 tb = 0;
10199 } else if (tb && !PyTraceBack_Check(tb)) {
10200 PyErr_SetString(PyExc_TypeError,
10201 "raise: arg 3 must be a traceback or None");
10202 goto bad;
10203 }
10204 if (value == Py_None)
10205 value = 0;
10206 if (PyExceptionInstance_Check(type)) {
10207 if (value) {
10208 PyErr_SetString(PyExc_TypeError,
10209 "instance exception may not have a separate value");
10210 goto bad;
10211 }
10212 value = type;
10213 type = (PyObject*) Py_TYPE(value);
10214 } else if (PyExceptionClass_Check(type)) {
10215 PyObject *instance_class = NULL;
10216 if (value && PyExceptionInstance_Check(value)) {
10217 instance_class = (PyObject*) Py_TYPE(value);
10218 if (instance_class != type) {
10219 int is_subclass = PyObject_IsSubclass(instance_class, type);
10220 if (!is_subclass) {
10221 instance_class = NULL;
10222 } else if (unlikely(is_subclass == -1)) {
10223 goto bad;
10224 } else {
10225 type = instance_class;
10226 }
10227 }
10228 }
10229 if (!instance_class) {
10230 PyObject *args;
10231 if (!value)
10232 args = PyTuple_New(0);
10233 else if (PyTuple_Check(value)) {
10234 Py_INCREF(value);
10235 args = value;
10236 } else
10237 args = PyTuple_Pack(1, value);
10238 if (!args)
10239 goto bad;
10240 owned_instance = PyObject_Call(type, args, NULL);
10241 Py_DECREF(args);
10242 if (!owned_instance)
10243 goto bad;
10244 value = owned_instance;
10245 if (!PyExceptionInstance_Check(value)) {
10246 PyErr_Format(PyExc_TypeError,
10247 "calling %R should have returned an instance of "
10248 "BaseException, not %R",
10249 type, Py_TYPE(value));
10250 goto bad;
10251 }
10252 }
10253 } else {
10254 PyErr_SetString(PyExc_TypeError,
10255 "raise: exception class must be a subclass of BaseException");
10256 goto bad;
10257 }
10258 if (cause) {
10259 PyObject *fixed_cause;
10260 if (cause == Py_None) {
10261 fixed_cause = NULL;
10262 } else if (PyExceptionClass_Check(cause)) {
10263 fixed_cause = PyObject_CallObject(cause, NULL);
10264 if (fixed_cause == NULL)
10265 goto bad;
10266 } else if (PyExceptionInstance_Check(cause)) {
10267 fixed_cause = cause;
10268 Py_INCREF(fixed_cause);
10269 } else {
10270 PyErr_SetString(PyExc_TypeError,
10271 "exception causes must derive from "
10272 "BaseException");
10273 goto bad;
10274 }
10275 PyException_SetCause(value, fixed_cause);
10276 }
10277 PyErr_SetObject(type, value);
10278 if (tb) {
10279#if PY_VERSION_HEX >= 0x030C00A6
10280 PyException_SetTraceback(value, tb);
10281#elif CYTHON_FAST_THREAD_STATE
10282 PyThreadState *tstate = __Pyx_PyThreadState_Current;
10283 PyObject* tmp_tb = tstate->curexc_traceback;
10284 if (tb != tmp_tb) {
10285 Py_INCREF(tb);
10286 tstate->curexc_traceback = tb;
10287 Py_XDECREF(tmp_tb);
10288 }
10289#else
10290 PyObject *tmp_type, *tmp_value, *tmp_tb;
10291 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
10292 Py_INCREF(tb);
10293 PyErr_Restore(tmp_type, tmp_value, tb);
10294 Py_XDECREF(tmp_tb);
10295#endif
10296 }
10297bad:
10298 Py_XDECREF(owned_instance);
10299 return;
10300}
10301
10302/* CopyObjectArray (used by TupleOrListFromArrayImpl) */
10303#if CYTHON_COMPILING_IN_CPYTHON
10304static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
10305 PyObject *v;
10306 Py_ssize_t i;
10307 for (i = 0; i < length; i++) {
10308 v = dest[i] = src[i];
10309 Py_INCREF(v);
10310 }
10311}
10312#endif
10313
10314/* TupleOrListFromArrayImpl (used by TupleFromArray) */
10315#if !(PY_VERSION_HEX >= 0x030F0000 && !CYTHON_COMPILING_IN_LIMITED_API)
10316CYTHON_UNUSED static PyObject *
10317__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) {
10318 if (n <= 0) {
10319 return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
10320 }
10321 PyObject *res = PyTuple_New(n);
10322 if (unlikely(res == NULL)) return NULL;
10323 #if CYTHON_COMPILING_IN_CPYTHON
10324 __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
10325 #else
10326 Py_ssize_t i;
10327 for (i = 0; i < n; i++) {
10328 Py_INCREF(src[i]);
10329 if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < (0))) {
10330 Py_DECREF(res);
10331 return NULL;
10332 }
10333 }
10334 #endif
10335 return res;
10336}
10337#endif
10338
10339/* PyObjectCompare (used by UnicodeEquals) */
10340#ifndef __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
10341#define __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
10342static CYTHON_INLINE int __Pyx_PyObject_CompareStrStrBoolEq(PyObject* s1, PyObject* s2) {
10343 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
10344 int result = PyUnicode_Equal(s1, s2);
10345 #if !CYTHON_COMPILING_IN_CPYTHON
10346 if (unlikely(result == -1)) return -1;
10347 #endif
10348 if (result == 0) goto __pyx_return_false; else goto __pyx_return_true;
10349 #else
10350 int result = PyUnicode_Compare(s1, s2);
10351 if (unlikely((result == -1) && PyErr_Occurred())) return -1;
10352 if (result == 0) goto __pyx_return_true; else goto __pyx_return_false;
10353 #endif
10354__pyx_return_true:
10355 return 1;
10356__pyx_return_false:
10357 return 0;
10358}
10359#endif
10360static CYTHON_INLINE int __Pyx_PyObject_CompareBoolEq_str_str(PyObject *op1, PyObject *op2, int pyop) {
10361 CYTHON_UNUSED_VAR(pyop);
10362 if (unlikely(op1 == Py_None)) {
10363 if (op2 == Py_None) goto __pyx_return_true; else goto __pyx_return_false;
10364 }
10365 if (unlikely(op2 == Py_None)) {
10366 if (op1 == Py_None) goto __pyx_return_true; else goto __pyx_return_false;
10367 }
10368
10369 if (likely(op1 != Py_None)) {
10370 if (op1 == op2) goto __pyx_return_true;
10371 if (likely(op2 != Py_None)) {
10372 return __Pyx_PyObject_CompareStrStrBoolEq(op1, op2);
10373 }
10374 goto __pyx_richcmp;
10375 }
10376
10377 if ((0)) goto __pyx_richcmp;
10378 if ((0)) goto __pyx_return_true;
10379 if ((0)) goto __pyx_return_false;
10380__pyx_richcmp:
10381 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_EQ);
10382__pyx_return_true:
10383 return 1;
10384__pyx_return_false:
10385 return 0;
10386}
10387
10388/* fastcall */
10389#if CYTHON_VECTORCALL
10390static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
10391{
10392 Py_ssize_t i, n = __Pyx_PyTuple_GET_SIZE(kwnames);
10393 #if !CYTHON_ASSUME_SAFE_SIZE
10394 if (unlikely(n == -1)) return NULL;
10395 #endif
10396 for (i = 0; i < n; i++)
10397 {
10398 PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
10399 #if !CYTHON_ASSUME_SAFE_MACROS
10400 if (unlikely(!namei)) return NULL;
10401 #endif
10402 if (s == namei) return kwvalues[i];
10403 }
10404 for (i = 0; i < n; i++)
10405 {
10406 PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
10407 #if !CYTHON_ASSUME_SAFE_MACROS
10408 if (unlikely(!namei)) return NULL;
10409 #endif
10410 int eq = __Pyx_PyUnicode_Equals(s, namei);
10411 if (unlikely(eq != 0)) {
10412 if (unlikely(eq < 0)) return NULL;
10413 return kwvalues[i];
10414 }
10415 }
10416 return NULL;
10417}
10418#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL
10419CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
10420 Py_ssize_t i, nkwargs;
10421 PyObject *dict;
10422#if !CYTHON_ASSUME_SAFE_SIZE
10423 nkwargs = PyTuple_Size(kwnames);
10424 if (unlikely(nkwargs < 0)) return NULL;
10425#else
10426 nkwargs = PyTuple_GET_SIZE(kwnames);
10427#endif
10428 dict = PyDict_New();
10429 if (unlikely(!dict))
10430 return NULL;
10431 for (i=0; i<nkwargs; i++) {
10432#if !CYTHON_ASSUME_SAFE_MACROS
10433 PyObject *key = PyTuple_GetItem(kwnames, i);
10434 if (!key) goto bad;
10435#else
10436 PyObject *key = PyTuple_GET_ITEM(kwnames, i);
10437#endif
10438 if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
10439 goto bad;
10440 }
10441 return dict;
10442bad:
10443 Py_DECREF(dict);
10444 return NULL;
10445}
10446#endif
10447#endif
10448
10449/* PyObjectCallOneArg (used by CallUnboundCMethod0) */
10450static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
10451 PyObject *args[2] = {NULL, arg};
10452 return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
10453}
10454
10455/* IgnoreException (used by UnpackUnboundCMethod_impl) */
10456static CYTHON_INLINE int __Pyx_IgnoreGivenException(PyObject *given_exception, PyObject *ignorable_exception) {
10457 if (PyErr_GivenExceptionMatches(given_exception ? given_exception : PyErr_Occurred(), ignorable_exception)) {
10458 PyErr_Clear();
10459 return 1;
10460 }
10461 return 0;
10462}
10463
10464/* UnpackUnboundCMethod_impl (used by UnpackUnboundCMethod) */
10465#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
10466static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) {
10467 PyObject *result;
10468 PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
10469 if (unlikely(!selfless_args)) return NULL;
10470 result = PyObject_Call(method, selfless_args, kwargs);
10471 Py_DECREF(selfless_args);
10472 return result;
10473}
10474#else
10475static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) {
10476 return PyObject_Vectorcall(method, args ? args+1 : NULL, nargs ? (size_t) nargs-1 : 0, kwnames);
10477}
10478#endif
10479static PyMethodDef __Pyx_UnboundCMethod_Def = {
10480 "CythonUnboundCMethod",
10481 __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall),
10482#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
10483 METH_VARARGS | METH_KEYWORDS,
10484#else
10485 METH_FASTCALL | METH_KEYWORDS,
10486#endif
10487 NULL
10488};
10489static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
10490 PyObject *method, *result=NULL;
10491 method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
10492 if (unlikely(!method))
10493 return -1;
10494 result = method;
10495#if CYTHON_COMPILING_IN_CPYTHON
10496 if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
10497 {
10498 PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
10499 target->func = descr->d_method->ml_meth;
10500 target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST);
10501 } else
10502#endif
10503#if CYTHON_COMPILING_IN_PYPY
10504#else
10505 if (PyCFunction_Check(method))
10506#endif
10507 {
10508 PyObject *self;
10509 int self_found;
10510#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
10511 self = PyObject_GetAttrString(method, "__self__");
10512 if (!self && !__Pyx_IgnoreException(PyExc_AttributeError)) {
10513 return -1;
10514 }
10515#else
10516 self = PyCFunction_GET_SELF(method);
10517#endif
10518 self_found = (self && self != Py_None);
10519#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
10520 Py_XDECREF(self);
10521#endif
10522 if (self_found) {
10523 PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method);
10524 if (unlikely(!unbound_method)) return -1;
10525 Py_DECREF(method);
10526 result = unbound_method;
10527 }
10528 }
10529#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
10530 if (unlikely(target->method)) {
10531 Py_DECREF(result);
10532 } else
10533#endif
10534 target->method = result;
10535 return 0;
10536}
10537
10538/* CallUnboundCMethod0 */
10539#if CYTHON_COMPILING_IN_CPYTHON
10540static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
10541 int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
10542 if (likely(was_initialized == 2 && cfunc->func)) {
10543 if (likely(cfunc->flag == METH_NOARGS))
10544 return __Pyx_CallCFunction(cfunc, self, NULL);
10545 if (likely(cfunc->flag == METH_FASTCALL))
10546 return __Pyx_CallCFunctionFast(cfunc, self, NULL, 0);
10547 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
10548 return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, NULL, 0, NULL);
10549 if (likely(cfunc->flag == (METH_VARARGS | METH_KEYWORDS)))
10550 return __Pyx_CallCFunctionWithKeywords(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple, NULL);
10551 if (cfunc->flag == METH_VARARGS)
10552 return __Pyx_CallCFunction(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple);
10553 return __Pyx__CallUnboundCMethod0(cfunc, self);
10554 }
10555#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
10556 else if (unlikely(was_initialized == 1)) {
10557 __Pyx_CachedCFunction tmp_cfunc = {
10558#ifndef __cplusplus
10559 0
10560#endif
10561 };
10562 tmp_cfunc.type = cfunc->type;
10563 tmp_cfunc.method_name = cfunc->method_name;
10564 return __Pyx__CallUnboundCMethod0(&tmp_cfunc, self);
10565 }
10566#endif
10567 PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self);
10568 __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
10569 return result;
10570}
10571#endif
10572static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
10573 PyObject *result;
10574 if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
10575 result = __Pyx_PyObject_CallOneArg(cfunc->method, self);
10576 return result;
10577}
10578
10579/* py_dict_items (used by OwnedDictNext) */
10580static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
10581 return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_items, d);
10582}
10583
10584/* py_dict_values (used by OwnedDictNext) */
10585static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
10586 return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_values, d);
10587}
10588
10589/* OwnedDictNext (used by ParseKeywordsImpl) */
10590#if CYTHON_AVOID_BORROWED_REFS
10591static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue) {
10592 PyObject *next = NULL;
10593 if (!*ppos) {
10594 if (pvalue) {
10595 PyObject *dictview = pkey ? __Pyx_PyDict_Items(p) : __Pyx_PyDict_Values(p);
10596 if (unlikely(!dictview)) goto bad;
10597 *ppos = PyObject_GetIter(dictview);
10598 Py_DECREF(dictview);
10599 } else {
10600 *ppos = PyObject_GetIter(p);
10601 }
10602 if (unlikely(!*ppos)) goto bad;
10603 }
10604 next = PyIter_Next(*ppos);
10605 if (!next) {
10606 if (PyErr_Occurred()) goto bad;
10607 return 0;
10608 }
10609 if (pkey && pvalue) {
10610 *pkey = __Pyx_PySequence_ITEM(next, 0);
10611 if (unlikely(*pkey)) goto bad;
10612 *pvalue = __Pyx_PySequence_ITEM(next, 1);
10613 if (unlikely(*pvalue)) goto bad;
10614 Py_DECREF(next);
10615 } else if (pkey) {
10616 *pkey = next;
10617 } else {
10618 assert(pvalue);
10619 *pvalue = next;
10620 }
10621 return 1;
10622 bad:
10623 Py_XDECREF(next);
10624#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
10625 PyErr_FormatUnraisable("Exception ignored in __Pyx_PyDict_NextRef");
10626#else
10627 PyErr_WriteUnraisable(__pyx_mstate_global->__pyx_n_u_Pyx_PyDict_NextRef);
10628#endif
10629 if (pkey) *pkey = NULL;
10630 if (pvalue) *pvalue = NULL;
10631 return 0;
10632}
10633#else // !CYTHON_AVOID_BORROWED_REFS
10634static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue) {
10635 int result = PyDict_Next(p, ppos, pkey, pvalue);
10636 if (likely(result == 1)) {
10637 if (pkey) Py_INCREF(*pkey);
10638 if (pvalue) Py_INCREF(*pvalue);
10639 }
10640 return result;
10641}
10642#endif
10643
10644/* RaiseDoubleKeywords (used by ParseKeywordsImpl) */
10645static void __Pyx_RaiseDoubleKeywordsError(
10646 const char* func_name,
10647 PyObject* kw_name)
10648{
10649 PyErr_Format(PyExc_TypeError,
10650 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
10651}
10652
10653/* CallUnboundCMethod2 */
10654#if CYTHON_COMPILING_IN_CPYTHON
10655static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
10656 int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
10657 if (likely(was_initialized == 2 && cfunc->func)) {
10658 PyObject *args[2] = {arg1, arg2};
10659 if (cfunc->flag == METH_FASTCALL) {
10660 return __Pyx_CallCFunctionFast(cfunc, self, args, 2);
10661 }
10662 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
10663 return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL);
10664 }
10665#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
10666 else if (unlikely(was_initialized == 1)) {
10667 __Pyx_CachedCFunction tmp_cfunc = {
10668#ifndef __cplusplus
10669 0
10670#endif
10671 };
10672 tmp_cfunc.type = cfunc->type;
10673 tmp_cfunc.method_name = cfunc->method_name;
10674 return __Pyx__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2);
10675 }
10676#endif
10677 PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
10678 __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
10679 return result;
10680}
10681#endif
10682static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
10683 if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
10684#if CYTHON_COMPILING_IN_CPYTHON
10685 if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
10686 PyObject *result = NULL;
10687 PyObject *args = PyTuple_New(2);
10688 if (unlikely(!args)) return NULL;
10689 Py_INCREF(arg1);
10690 PyTuple_SET_ITEM(args, 0, arg1);
10691 Py_INCREF(arg2);
10692 PyTuple_SET_ITEM(args, 1, arg2);
10693 if (cfunc->flag & METH_KEYWORDS)
10694 result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL);
10695 else
10696 result = __Pyx_CallCFunction(cfunc, self, args);
10697 Py_DECREF(args);
10698 return result;
10699 }
10700#endif
10701 {
10702 PyObject *args[4] = {NULL, self, arg1, arg2};
10703 return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
10704 }
10705}
10706
10707/* ParseKeywordsImpl (used by ParseKeywords) */
10708static int __Pyx_ValidateDuplicatePosArgs(
10709 PyObject *kwds,
10710 PyObject ** const argnames[],
10711 PyObject ** const *first_kw_arg,
10712 const char* function_name)
10713{
10714 PyObject ** const *name = argnames;
10715 while (name != first_kw_arg) {
10716 PyObject *key = **name;
10717 int found = PyDict_Contains(kwds, key);
10718 if (unlikely(found)) {
10719 if (found == 1) __Pyx_RaiseDoubleKeywordsError(function_name, key);
10720 goto bad;
10721 }
10722 name++;
10723 }
10724 return 0;
10725bad:
10726 return -1;
10727}
10728#if CYTHON_USE_UNICODE_INTERNALS
10729static CYTHON_INLINE int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) {
10730 int kind;
10731 Py_ssize_t len = PyUnicode_GET_LENGTH(s1);
10732 if (len != PyUnicode_GET_LENGTH(s2)) return 0;
10733 kind = PyUnicode_KIND(s1);
10734 if (kind != PyUnicode_KIND(s2)) return 0;
10735 const void *data1 = PyUnicode_DATA(s1);
10736 const void *data2 = PyUnicode_DATA(s2);
10737 return (memcmp(data1, data2, (size_t) len * (size_t) kind) == 0);
10738}
10739#endif
10740static int __Pyx_MatchKeywordArg_str(
10741 PyObject *key,
10742 PyObject ** const argnames[],
10743 PyObject ** const *first_kw_arg,
10744 size_t *index_found,
10745 const char *function_name)
10746{
10747 PyObject ** const *name;
10748 #if CYTHON_USE_UNICODE_INTERNALS
10749 Py_hash_t key_hash = ((PyASCIIObject*)key)->hash;
10750 if (unlikely(key_hash == -1)) {
10751 key_hash = PyObject_Hash(key);
10752 if (unlikely(key_hash == -1))
10753 goto bad;
10754 }
10755 #endif
10756 name = first_kw_arg;
10757 while (*name) {
10758 PyObject *name_str = **name;
10759 #if CYTHON_USE_UNICODE_INTERNALS
10760 if (key_hash == ((PyASCIIObject*)name_str)->hash && __Pyx_UnicodeKeywordsEqual(name_str, key)) {
10761 *index_found = (size_t) (name - argnames);
10762 return 1;
10763 }
10764 #else
10765 #if CYTHON_ASSUME_SAFE_SIZE
10766 if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
10767 #endif
10768 {
10769 int cmp = PyUnicode_Compare(name_str, key);
10770 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
10771 if (cmp == 0) {
10772 *index_found = (size_t) (name - argnames);
10773 return 1;
10774 }
10775 }
10776 #endif
10777 name++;
10778 }
10779 name = argnames;
10780 while (name != first_kw_arg) {
10781 PyObject *name_str = **name;
10782 #if CYTHON_USE_UNICODE_INTERNALS
10783 if (unlikely(key_hash == ((PyASCIIObject*)name_str)->hash)) {
10784 if (__Pyx_UnicodeKeywordsEqual(name_str, key))
10785 goto arg_passed_twice;
10786 }
10787 #else
10788 #if CYTHON_ASSUME_SAFE_SIZE
10789 if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
10790 #endif
10791 {
10792 if (unlikely(name_str == key)) goto arg_passed_twice;
10793 int cmp = PyUnicode_Compare(name_str, key);
10794 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
10795 if (cmp == 0) goto arg_passed_twice;
10796 }
10797 #endif
10798 name++;
10799 }
10800 return 0;
10801arg_passed_twice:
10802 __Pyx_RaiseDoubleKeywordsError(function_name, key);
10803 goto bad;
10804bad:
10805 return -1;
10806}
10807static int __Pyx_MatchKeywordArg_nostr(
10808 PyObject *key,
10809 PyObject ** const argnames[],
10810 PyObject ** const *first_kw_arg,
10811 size_t *index_found,
10812 const char *function_name)
10813{
10814 PyObject ** const *name;
10815 if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type;
10816 name = first_kw_arg;
10817 while (*name) {
10818 int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
10819 if (cmp == 1) {
10820 *index_found = (size_t) (name - argnames);
10821 return 1;
10822 }
10823 if (unlikely(cmp == -1)) goto bad;
10824 name++;
10825 }
10826 name = argnames;
10827 while (name != first_kw_arg) {
10828 int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
10829 if (unlikely(cmp != 0)) {
10830 if (cmp == 1) goto arg_passed_twice;
10831 else goto bad;
10832 }
10833 name++;
10834 }
10835 return 0;
10836arg_passed_twice:
10837 __Pyx_RaiseDoubleKeywordsError(function_name, key);
10838 goto bad;
10839invalid_keyword_type:
10840 PyErr_Format(PyExc_TypeError,
10841 "%.200s() keywords must be strings", function_name);
10842 goto bad;
10843bad:
10844 return -1;
10845}
10846static CYTHON_INLINE int __Pyx_MatchKeywordArg(
10847 PyObject *key,
10848 PyObject ** const argnames[],
10849 PyObject ** const *first_kw_arg,
10850 size_t *index_found,
10851 const char *function_name)
10852{
10853 return likely(PyUnicode_CheckExact(key)) ?
10854 __Pyx_MatchKeywordArg_str(key, argnames, first_kw_arg, index_found, function_name) :
10855 __Pyx_MatchKeywordArg_nostr(key, argnames, first_kw_arg, index_found, function_name);
10856}
10857static void __Pyx_RejectUnknownKeyword(
10858 PyObject *kwds,
10859 PyObject ** const argnames[],
10860 PyObject ** const *first_kw_arg,
10861 const char *function_name)
10862{
10863 #if CYTHON_AVOID_BORROWED_REFS
10864 PyObject *pos = NULL;
10865 #else
10866 Py_ssize_t pos = 0;
10867 #endif
10868 PyObject *key = NULL;
10869 __Pyx_BEGIN_CRITICAL_SECTION(kwds);
10870 #if CYTHON_AVOID_BORROWED_REFS
10871 while (__Pyx_PyDict_NextRef(kwds, &pos, &key, NULL))
10872 #else
10873 (void) __Pyx_PyDict_NextRef;
10874 while (PyDict_Next(kwds, &pos, &key, NULL))
10875 #endif
10876 {
10877 PyObject** const *name = first_kw_arg;
10878 while (*name && (**name != key)) name++;
10879 if (!*name) {
10880 size_t index_found = 0;
10881 int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
10882 if (cmp != 1) {
10883 if (cmp == 0) {
10884 PyErr_Format(PyExc_TypeError,
10885 "%s() got an unexpected keyword argument '%U'",
10886 function_name, key);
10887 }
10888 #if CYTHON_AVOID_BORROWED_REFS
10889 Py_DECREF(key);
10890 #endif
10891 break;
10892 }
10893 }
10894 #if CYTHON_AVOID_BORROWED_REFS
10895 Py_DECREF(key);
10896 #endif
10897 }
10898 __Pyx_END_CRITICAL_SECTION();
10899 #if CYTHON_AVOID_BORROWED_REFS
10900 Py_XDECREF(pos);
10901 #endif
10902 assert(PyErr_Occurred());
10903}
10904static int __Pyx_ParseKeywordDict(
10905 PyObject *kwds,
10906 PyObject ** const argnames[],
10907 PyObject *values[],
10908 Py_ssize_t num_pos_args,
10909 Py_ssize_t num_kwargs,
10910 const char* function_name,
10911 int ignore_unknown_kwargs)
10912{
10913 PyObject** const *name;
10914 PyObject** const *first_kw_arg = argnames + num_pos_args;
10915 Py_ssize_t extracted = 0;
10916#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
10917 if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
10918#endif
10919 name = first_kw_arg;
10920 while (*name && num_kwargs > extracted) {
10921 PyObject * key = **name;
10922 PyObject *value;
10923 int found = 0;
10924 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
10925 found = PyDict_GetItemRef(kwds, key, &value);
10926 #else
10927 value = PyDict_GetItemWithError(kwds, key);
10928 if (value) {
10929 Py_INCREF(value);
10930 found = 1;
10931 } else {
10932 if (unlikely(PyErr_Occurred())) goto bad;
10933 }
10934 #endif
10935 if (found) {
10936 if (unlikely(found < 0)) goto bad;
10937 values[name-argnames] = value;
10938 extracted++;
10939 }
10940 name++;
10941 }
10942 if (num_kwargs > extracted) {
10943 if (ignore_unknown_kwargs) {
10944 if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1))
10945 goto bad;
10946 } else {
10947 __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name);
10948 goto bad;
10949 }
10950 }
10951 return 0;
10952bad:
10953 return -1;
10954}
10955static int __Pyx_ParseKeywordDictToDict(
10956 PyObject *kwds,
10957 PyObject ** const argnames[],
10958 PyObject *kwds2,
10959 PyObject *values[],
10960 Py_ssize_t num_pos_args,
10961 const char* function_name)
10962{
10963 PyObject** const *name;
10964 PyObject** const *first_kw_arg = argnames + num_pos_args;
10965 Py_ssize_t len;
10966#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
10967 if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
10968#endif
10969 if (PyDict_Update(kwds2, kwds) < 0) goto bad;
10970 name = first_kw_arg;
10971 while (*name) {
10972 PyObject *key = **name;
10973 PyObject *value;
10974#if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop))
10975 int found = PyDict_Pop(kwds2, key, &value);
10976 if (found) {
10977 if (unlikely(found < 0)) goto bad;
10978 values[name-argnames] = value;
10979 }
10980#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
10981 int found = PyDict_GetItemRef(kwds2, key, &value);
10982 if (found) {
10983 if (unlikely(found < 0)) goto bad;
10984 values[name-argnames] = value;
10985 if (unlikely(PyDict_DelItem(kwds2, key) < 0)) goto bad;
10986 }
10987#else
10988 #if CYTHON_COMPILING_IN_CPYTHON
10989 value = _PyDict_Pop(kwds2, key, kwds2);
10990 #else
10991 value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2);
10992 #endif
10993 if (value == kwds2) {
10994 Py_DECREF(value);
10995 } else {
10996 if (unlikely(!value)) goto bad;
10997 values[name-argnames] = value;
10998 }
10999#endif
11000 name++;
11001 }
11002 len = PyDict_Size(kwds2);
11003 if (len > 0) {
11004 return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name);
11005 } else if (unlikely(len == -1)) {
11006 goto bad;
11007 }
11008 return 0;
11009bad:
11010 return -1;
11011}
11012static int __Pyx_ParseKeywordsTuple(
11013 PyObject *kwds,
11014 PyObject * const *kwvalues,
11015 PyObject ** const argnames[],
11016 PyObject *kwds2,
11017 PyObject *values[],
11018 Py_ssize_t num_pos_args,
11019 Py_ssize_t num_kwargs,
11020 const char* function_name,
11021 int ignore_unknown_kwargs)
11022{
11023 PyObject *key = NULL;
11024 PyObject** const * name;
11025 PyObject** const *first_kw_arg = argnames + num_pos_args;
11026 for (Py_ssize_t pos = 0; pos < num_kwargs; pos++) {
11027#if CYTHON_AVOID_BORROWED_REFS
11028 key = __Pyx_PySequence_ITEM(kwds, pos);
11029#else
11030 key = __Pyx_PyTuple_GET_ITEM(kwds, pos);
11031#endif
11032#if !CYTHON_ASSUME_SAFE_MACROS
11033 if (unlikely(!key)) goto bad;
11034#endif
11035 name = first_kw_arg;
11036 while (*name && (**name != key)) name++;
11037 if (*name) {
11038 PyObject *value = kwvalues[pos];
11039 values[name-argnames] = __Pyx_NewRef(value);
11040 } else {
11041 size_t index_found = 0;
11042 int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
11043 if (cmp == 1) {
11044 PyObject *value = kwvalues[pos];
11045 values[index_found] = __Pyx_NewRef(value);
11046 } else {
11047 if (unlikely(cmp == -1)) goto bad;
11048 if (kwds2) {
11049 PyObject *value = kwvalues[pos];
11050 if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
11051 } else if (!ignore_unknown_kwargs) {
11052 goto invalid_keyword;
11053 }
11054 }
11055 }
11056 #if CYTHON_AVOID_BORROWED_REFS
11057 Py_DECREF(key);
11058 key = NULL;
11059 #endif
11060 }
11061 return 0;
11062invalid_keyword:
11063 PyErr_Format(PyExc_TypeError,
11064 "%s() got an unexpected keyword argument '%U'",
11065 function_name, key);
11066 goto bad;
11067bad:
11068 #if CYTHON_AVOID_BORROWED_REFS
11069 Py_XDECREF(key);
11070 #endif
11071 return -1;
11072}
11073
11074/* ParseKeywords */
11075static int __Pyx_ParseKeywords(
11076 PyObject *kwds,
11077 PyObject * const *kwvalues,
11078 PyObject ** const argnames[],
11079 PyObject *kwds2,
11080 PyObject *values[],
11081 Py_ssize_t num_pos_args,
11082 Py_ssize_t num_kwargs,
11083 const char* function_name,
11084 int ignore_unknown_kwargs)
11085{
11086 if (CYTHON_VECTORCALL && likely(PyTuple_Check(kwds)))
11087 return __Pyx_ParseKeywordsTuple(kwds, kwvalues, argnames, kwds2, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
11088 else if (kwds2)
11089 return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name);
11090 else
11091 return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
11092}
11093
11094/* RaiseArgTupleInvalid */
11095static void __Pyx_RaiseArgtupleInvalid(
11096 const char* func_name,
11097 int exact,
11098 Py_ssize_t num_min,
11099 Py_ssize_t num_max,
11100 Py_ssize_t num_found)
11101{
11102 Py_ssize_t num_expected;
11103 const char *more_or_less;
11104 if (num_found < num_min) {
11105 num_expected = num_min;
11106 more_or_less = "at least";
11107 } else {
11108 num_expected = num_max;
11109 more_or_less = "at most";
11110 }
11111 if (exact) {
11112 more_or_less = "exactly";
11113 }
11114 PyErr_Format(PyExc_TypeError,
11115 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
11116 func_name, more_or_less, num_expected,
11117 (num_expected == 1) ? "" : "s", num_found);
11118}
11119
11120/* PyObjectLookupSpecial */
11121#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
11122static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) {
11123 PyObject *res;
11124 PyTypeObject *tp = Py_TYPE(obj);
11125 res = _PyType_Lookup(tp, attr_name);
11126 if (likely(res)) {
11127 descrgetfunc f = Py_TYPE(res)->tp_descr_get;
11128 if (!f) {
11129 Py_INCREF(res);
11130 } else {
11131 res = f(res, obj, (PyObject *)tp);
11132 }
11133 } else if (with_error) {
11134 PyErr_SetObject(PyExc_AttributeError, attr_name);
11135 }
11136 return res;
11137}
11138#endif
11139
11140/* PyObjectCompare */
11141#ifndef __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
11142#define __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
11143static CYTHON_INLINE int __Pyx_PyObject_CompareStrStrBoolEq(PyObject* s1, PyObject* s2) {
11144 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
11145 int result = PyUnicode_Equal(s1, s2);
11146 #if !CYTHON_COMPILING_IN_CPYTHON
11147 if (unlikely(result == -1)) return -1;
11148 #endif
11149 if (result == 0) goto __pyx_return_false; else goto __pyx_return_true;
11150 #else
11151 int result = PyUnicode_Compare(s1, s2);
11152 if (unlikely((result == -1) && PyErr_Occurred())) return -1;
11153 if (result == 0) goto __pyx_return_true; else goto __pyx_return_false;
11154 #endif
11155__pyx_return_true:
11156 return 1;
11157__pyx_return_false:
11158 return 0;
11159}
11160#endif
11161static CYTHON_INLINE int __Pyx_PyObject_CompareBoolEq_object_str(PyObject *op1, PyObject *op2, int pyop) {
11162 CYTHON_UNUSED_VAR(pyop);
11163 if (unlikely(op2 == Py_None)) {
11164 if (op1 == Py_None) goto __pyx_return_true; else goto __pyx_richcmp;
11165 }
11166 if (PyFloat_CheckExact(op1)) {
11167 goto __pyx_richcmp;
11168 }
11169 if (PyLong_CheckExact(op1)) {
11170 if (op1 == op2) goto __pyx_return_true;
11171 goto __pyx_richcmp;
11172 }
11173
11174 if (likely(PyUnicode_CheckExact(op1))) {
11175 if (op1 == op2) goto __pyx_return_true;
11176 if (likely(op2 != Py_None)) {
11177 return __Pyx_PyObject_CompareStrStrBoolEq(op1, op2);
11178 }
11179 goto __pyx_richcmp;
11180 }
11181
11182 if ((0)) goto __pyx_richcmp;
11183 if ((0)) goto __pyx_return_true;
11184 if ((0)) goto __pyx_return_false;
11185__pyx_richcmp:
11186 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_EQ);
11187__pyx_return_true:
11188 return 1;
11189__pyx_return_false:
11190 return 0;
11191}
11192
11193/* PyDictVersioning (used by GetModuleGlobalName) */
11194#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
11195static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
11196 PyObject *dict = Py_TYPE(obj)->tp_dict;
11197 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
11198}
11199static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
11200 PyObject **dictptr = NULL;
11201 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
11202 if (offset) {
11203#if CYTHON_COMPILING_IN_CPYTHON
11204 dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
11205#else
11206 dictptr = _PyObject_GetDictPtr(obj);
11207#endif
11208 }
11209 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
11210}
11211static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
11212 PyObject *dict = Py_TYPE(obj)->tp_dict;
11213 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
11214 return 0;
11215 return obj_dict_version == __Pyx_get_object_dict_version(obj);
11216}
11217#endif
11218
11219/* GetModuleGlobalName */
11220#if CYTHON_USE_DICT_VERSIONS
11221static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
11222#else
11223static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
11224#endif
11225{
11226 PyObject *result;
11227#if CYTHON_COMPILING_IN_LIMITED_API
11228 if (unlikely(!__pyx_m)) {
11229 if (!PyErr_Occurred())
11230 PyErr_SetNone(PyExc_NameError);
11231 return NULL;
11232 }
11233 result = PyObject_GetAttr(__pyx_m, name);
11234 if (likely(result)) {
11235 return result;
11236 }
11237 if (!__Pyx_IgnoreException(PyExc_Exception)) {
11238 return NULL; // BaseException
11239 }
11240#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
11241 if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) {
11242 if (!__Pyx_IgnoreException(PyExc_Exception)) {
11243 return NULL; // BaseException
11244 }
11245 }
11246 __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
11247 if (likely(result)) {
11248 return result;
11249 }
11250#else
11251 result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash);
11252 __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
11253 if (likely(result)) {
11254 return __Pyx_NewRef(result);
11255 }
11256 PyObject *exc = PyErr_Occurred();
11257 if (unlikely(exc) && !__Pyx_IgnoreGivenException(exc, PyExc_Exception)) {
11258 return NULL; // BaseException
11259 }
11260#endif
11261 return __Pyx_GetBuiltinName(name);
11262}
11263
11264/* FormatTypeName (used by RaiseErrorWithObjectTypes) */
11265#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
11266static __Pyx_TypeName
11267__Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp)
11268{
11269 PyObject *module = NULL, *name = NULL, *result = NULL;
11270 #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
11271 name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
11272 __pyx_mstate_global->__pyx_n_u_qualname);
11273 #else
11274 name = PyType_GetQualName(tp);
11275 #endif
11276 if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) goto bad;
11277 module = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
11278 __pyx_mstate_global->__pyx_n_u_module);
11279 if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module))) goto bad;
11280 if (PyUnicode_CompareWithASCIIString(module, "builtins") == 0) {
11281 result = name;
11282 name = NULL;
11283 goto done;
11284 }
11285 result = PyUnicode_FromFormat("%U.%U", module, name);
11286 if (unlikely(result == NULL)) goto bad;
11287 done:
11288 Py_XDECREF(name);
11289 Py_XDECREF(module);
11290 return result;
11291 bad:
11292 PyErr_Clear();
11293 if (name) {
11294 result = name;
11295 name = NULL;
11296 } else {
11297 result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u_);
11298 }
11299 goto done;
11300}
11301#endif
11302
11303/* RaiseErrorWithObjectTypes (used by PyNumberBinop) */
11304static void __Pyx_RaiseErrorWithTypes1(PyObject* exc_type, const char *message, const char *arg, PyTypeObject *type_obj1, PyTypeObject *type_obj2) {
11305 __Pyx_TypeName type_name1 = __Pyx_PyType_GetFullyQualifiedName(type_obj1);
11306 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
11307 if (unlikely(!type_name1)) return;
11308 #endif
11309 __Pyx_TypeName type_name2 = __Pyx_PyType_GetFullyQualifiedName(type_obj2);
11310 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
11311 if (unlikely(!type_name2)) goto type2_failed;
11312 #endif
11313 PyErr_Format(exc_type, message, arg, type_name1, type_name2);
11314 __Pyx_DECREF_TypeName(type_name2);
11315#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
11316type2_failed:
11317#endif
11318 __Pyx_DECREF_TypeName(type_name1);
11319}
11320
11321/* PyNumberBinop */
11322#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API)
11323#if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
11324#ifndef __Pyx_DEFINED_BinopTypeError
11325#define __Pyx_DEFINED_BinopTypeError
11326static void __Pyx_BinopTypeError(PyObject *op1, PyObject *op2, const char* op, int inplace) {
11327 char opname[4] = {op[0], op[1], 0, 0};
11328 if (inplace) {
11329 opname[op[1] ? 2 : 1] = '=';
11330 }
11331 __Pyx_RaiseErrorWithObjectTypes1(
11332 PyExc_TypeError,
11333 "unsupported operand type(s) for %.3s: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'",
11334 opname, op1, op2);
11335}
11336#endif
11337#endif
11338#ifndef __Pyx_DEFINED_PyNumber_Multiply_xfloat_object
11339#define __Pyx_DEFINED_PyNumber_Multiply_xfloat_object
11340static PyObject* __Pyx_PyNumber_Multiply_xfloat_object(PyObject *op1, PyObject *op2, int inplace) {
11341 if (PyLong_CheckExact(op2)) {
11342 double int_op2;
11343 #if CYTHON_USE_PYLONG_INTERNALS
11344 if (__Pyx_PyLong_IsCompact(op2)) {
11345 Py_ssize_t compact_op2 = __Pyx_PyLong_CompactValue(op2);
11346 int_op2 = (double) compact_op2;
11347 } else
11348 #endif
11349 {
11350 int_op2 = PyLong_AsDouble(op2);
11351 if (unlikely((int_op2 == -1.) && PyErr_Occurred())) return NULL;
11352 }
11353 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
11354 #if !CYTHON_ASSUME_SAFE_MACROS
11355 if (unlikely((float_op1 == -1.) && PyErr_Occurred())) return NULL;
11356 #endif
11357 if (float_op1 == 0.) return __Pyx_NewRef(op1);
11358 return PyFloat_FromDouble(float_op1 * int_op2);
11359 }
11360 if (PyLong_Check(op2)) {
11361 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(&PyFloat_Type, tp_as_number, nb_multiply, binaryfunc);
11362 if (likely(slot_func)) {
11363 return slot_func(op1, op2);
11364 }
11365 }
11366 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
11367 {
11368 PyTypeObject *type_op2 = Py_TYPE(op2);
11369 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_multiply, binaryfunc);
11370 if (likely(slot_func)) {
11371 PyObject *result = slot_func(op1, op2);
11372 if (likely(result != Py_NotImplemented)) {
11373 return result;
11374 }
11375 Py_DECREF(result);
11376 }
11377 __Pyx_BinopTypeError(op1, op2, "*", inplace);
11378 return NULL;
11379 }
11380 #else
11381 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
11382 #endif
11383}
11384#endif
11385#ifndef __Pyx_DEFINED_PyNumber_Multiply_xint_object
11386#define __Pyx_DEFINED_PyNumber_Multiply_xint_object
11387static PyObject* __Pyx_PyNumber_Multiply_xint_object(PyObject *op1, PyObject *op2, int inplace) {
11388 if (PyFloat_CheckExact(op2)) {
11389 double int_op1;
11390 #if CYTHON_USE_PYLONG_INTERNALS
11391 if (__Pyx_PyLong_IsCompact(op1)) {
11392 Py_ssize_t compact_op1 = __Pyx_PyLong_CompactValue(op1);
11393 int_op1 = (double) compact_op1;
11394 } else
11395 #endif
11396 {
11397 int_op1 = PyLong_AsDouble(op1);
11398 if (unlikely((int_op1 == -1.) && PyErr_Occurred())) return NULL;
11399 }
11400 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
11401 #if !CYTHON_ASSUME_SAFE_MACROS
11402 if (unlikely((float_op2 == -1.) && PyErr_Occurred())) return NULL;
11403 #endif
11404 return PyFloat_FromDouble(int_op1 * float_op2);
11405 }
11406 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
11407 {
11408 PyTypeObject *type_op2 = Py_TYPE(op2);
11409 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_multiply, binaryfunc);
11410 if (likely(slot_func)) {
11411 PyObject *result = slot_func(op1, op2);
11412 if (likely(result != Py_NotImplemented)) {
11413 return result;
11414 }
11415 Py_DECREF(result);
11416 }
11417 ssizeargfunc repeat_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_sequence, sq_repeat, ssizeargfunc);
11418 if (likely(repeat_func)) {
11419 Py_ssize_t count;
11420 #if CYTHON_USE_PYLONG_INTERNALS
11421 if (__Pyx_PyLong_IsCompact(op1)) {
11422 count = __Pyx_PyLong_CompactValue(op1);
11423 } else
11424 #endif
11425 {
11426 count = PyLong_AsSsize_t(op1);
11427 if (unlikely((count == -1) && PyErr_Occurred())) return NULL;
11428 }
11429 return repeat_func(op2, count);
11430 }
11431 __Pyx_BinopTypeError(op1, op2, "*", inplace);
11432 return NULL;
11433 }
11434 #else
11435 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
11436 #endif
11437}
11438#endif
11439static CYTHON_INLINE PyObject* __Pyx__PyNumber_Multiply_object_object(PyObject *op1, PyObject *op2, int inplace) {
11440 if (PyFloat_CheckExact(op1)) {
11441 if (PyFloat_CheckExact(op2)) {
11442 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
11443 #if !CYTHON_ASSUME_SAFE_MACROS
11444 if (unlikely((float_op2 == -1.) && PyErr_Occurred())) return NULL;
11445 #endif
11446 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
11447 #if !CYTHON_ASSUME_SAFE_MACROS
11448 if (unlikely((float_op1 == -1.) && PyErr_Occurred())) return NULL;
11449 #endif
11450 return PyFloat_FromDouble(float_op1 * float_op2);
11451 }
11452 return __Pyx_PyNumber_Multiply_xfloat_object(op1, op2, inplace);
11453 }
11454 if (PyLong_CheckExact(op1)) {
11455 if (PyLong_CheckExact(op2)) {
11456 #if CYTHON_USE_PYLONG_INTERNALS
11457 if (__Pyx_PyLong_IsCompact(op1)) {
11458 long long int_op1 = (long long) __Pyx_PyLong_CompactValue(op1);
11459 if (int_op1 == 0) return __Pyx_NewRef(op1);
11460 if (__Pyx_PyLong_IsCompact(op2)) {
11461 long long int_op2 = (long long) __Pyx_PyLong_CompactValue(op2);
11462 if (int_op2 == 0) return __Pyx_NewRef(op2);
11463 return PyLong_FromLongLong(int_op1 * int_op2);
11464 }
11465 }
11466 else if (__Pyx_PyLong_IsZero(op2)) return __Pyx_NewRef(op2);
11467 #endif
11468 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(&PyLong_Type, tp_as_number, nb_multiply, binaryfunc);
11469 if (likely(slot_func)) {
11470 return slot_func(op1, op2);
11471 }
11472 }
11473 return __Pyx_PyNumber_Multiply_xint_object(op1, op2, inplace);
11474 }
11475 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
11476}
11477#endif
11478
11479/* RaiseUnboundLocalError */
11480static void __Pyx_RaiseUnboundLocalError(const char *varname) {
11481 PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
11482}
11483
11484/* PyObjectVectorcallKwds (used by PyObjectVectorcallMethodKwds) */
11485#if CYTHON_VECTORCALL
11486CYTHON_UNUSED static int __Pyx_CheckVectorcallKwarg(PyObject *kwnames, Py_ssize_t i) {
11487 PyObject *key = __Pyx_PyTuple_GET_ITEM(kwnames, i);
11488#if !CYTHON_ASSUME_SAFE_MACROS
11489 if (unlikely(!key)) return -1;
11490#endif
11491 if (unlikely(!PyUnicode_Check(key))) {
11492 PyErr_SetString(PyExc_TypeError, "keywords must be strings");
11493 return -1;
11494 }
11495 return 0;
11496}
11497#else
11498CYTHON_UNUSED static PyObject *__Pyx_MakeKwargDict(PyObject **keys, PyObject **values, Py_ssize_t n) {
11499 PyObject *out = PyDict_New();
11500 if (unlikely(!out)) return NULL;
11501 for (Py_ssize_t i=0; i<n; ++i) {
11502 if (unlikely(PyDict_SetItem(out, keys[i], values[i]) < 0)) {
11503 Py_DECREF(out);
11504 return NULL;
11505 }
11506 }
11507 return out;
11508}
11509CYTHON_UNUSED static int __Pyx_CheckVectorcallKwarg(PyObject **kwnames, Py_ssize_t i) {
11510 PyObject *key = kwnames[i];
11511 if (unlikely(!PyUnicode_Check(key))) {
11512 PyErr_SetString(PyExc_TypeError, "keywords must be strings");
11513 return -1;
11514 }
11515 return 0;
11516}
11517#endif
11518
11519/* PyObjectVectorcallMethodKwds */
11520#if !CYTHON_VECTORCALL
11521static PyObject *__Pyx_Object_VectorcallMethodKwds(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
11522 PyObject *result;
11523 PyObject *obj = PyObject_GetAttr(args[0], name);
11524 if (unlikely(!obj))
11525 return NULL;
11526 result = __Pyx_Object_VectorcallKwds(obj, args+1, nargsf-1, kwnames);
11527 Py_DECREF(obj);
11528 return result;
11529}
11530#endif
11531
11532/* RaiseErrorWithObjectType1 (used by RaiseUnexpectedTypeError) */
11533static void __Pyx_RaiseErrorWithType1(PyObject* exc_type, const char* message, const char *arg, PyTypeObject *type_obj) {
11534 __Pyx_TypeName type_name = __Pyx_PyType_GetFullyQualifiedName(type_obj);
11535 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
11536 if (unlikely(!type_name)) return;
11537 #endif
11538 PyErr_Format(exc_type, message, arg, type_name);
11539 __Pyx_DECREF_TypeName(type_name);
11540}
11541
11542/* RaiseUnexpectedTypeError */
11543static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) {
11544 __Pyx_RaiseTypeErrorWithObjectType1(
11545 "Expected %.42s, got " __Pyx_FMT_TYPENAME,
11546 expected, obj);
11547 return 0;
11548}
11549
11550/* PyObjectFastCallMethod */
11551#if !CYTHON_VECTORCALL
11552static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf) {
11553 PyObject *result;
11554 switch (__Pyx_PyVectorcall_NARGS(nargsf)) {
11555 case 1:
11556 return PyObject_CallMethodObjArgs(args[0], name, NULL);
11557 case 2:
11558 return PyObject_CallMethodObjArgs(args[0], name, args[1], NULL);
11559 case 3:
11560 return PyObject_CallMethodObjArgs(args[0], name, args[1], args[2], NULL);
11561 case 4:
11562 return PyObject_CallMethodObjArgs(args[0], name, args[1], args[2], args[3], NULL);
11563 case 5:
11564 return PyObject_CallMethodObjArgs(args[0], name, args[1], args[2], args[3], args[4], NULL);
11565 }
11566 PyObject *attr = PyObject_GetAttr(args[0], name);
11567 if (unlikely(!attr))
11568 return NULL;
11569 result = __Pyx_PyObject_FastCall(attr, args+1, nargsf - 1);
11570 Py_DECREF(attr);
11571 return result;
11572}
11573#endif
11574
11575/* PyFrozenDict (used by GetItemInt) */
11576#if CYTHON_COMPILING_IN_LIMITED_API
11577static CYTHON_INLINE PyObject* __Pyx__PyFrozenDict_New(PyObject* frozendict_type, PyObject* it) {
11578 return PyObject_CallFunctionObjArgs(frozendict_type, it, NULL);
11579}
11580#endif
11581
11582/* GettItemInt_wraparound (used by GetItemInt) */
11583#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
11584static int __Pyx_GetItemInt_wraparound(PyObject *o, PySequenceMethods *sm, Py_ssize_t *i) {
11585 assert(*i < 0);
11586 if (likely(sm->sq_length)) {
11587 Py_ssize_t l = sm->sq_length(o);
11588 if (likely(l >= 0)) {
11589 *i += l;
11590 } else {
11591 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
11592 return -1;
11593 PyErr_Clear();
11594 }
11595 }
11596 return 0;
11597}
11598#endif
11599
11600/* GetItemInt */
11601static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
11602 PyObject *r;
11603 if (unlikely(!j)) return NULL;
11604 r = PyObject_GetItem(o, j);
11605 Py_DECREF(j);
11606 return r;
11607}
11608static PyObject *__Pyx_GetItemInt_Generic_size(PyObject *o, Py_ssize_t i) {
11609 return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
11610}
11611static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
11612 int wraparound, int boundscheck, int unsafe_shared) {
11613 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
11614#if CYTHON_AVOID_BORROWED_REFS
11615 CYTHON_UNUSED_VAR(boundscheck);
11616 Py_ssize_t wrapped_i = i;
11617 if (wraparound & unlikely(i < 0)) {
11618 Py_ssize_t size = __Pyx_PyList_GET_SIZE(o);
11619 #if !CYTHON_ASSUME_SAFE_SIZE
11620 if (unlikely(size < 0)) return NULL;
11621 #endif
11622 wrapped_i += size;
11623 }
11624 return __Pyx_PyList_GetItemRef(o, wrapped_i);
11625#elif CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
11626 Py_ssize_t wrapped_i = i;
11627 Py_ssize_t size = (wraparound | boundscheck) ? PyList_GET_SIZE(o) : -1;
11628 if (wraparound & unlikely(i < 0)) {
11629 wrapped_i += size;
11630 }
11631 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, size))) {
11632 return __Pyx_PyList_GET_ITEM_REF(o, wrapped_i, unsafe_shared);
11633 }
11634 return __Pyx_GetItemInt_Generic_size(o, i);
11635#else
11636 (void)wraparound;
11637 (void)boundscheck;
11638 return PySequence_GetItem(o, i);
11639#endif
11640}
11641static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
11642 int wraparound, int boundscheck, int unsafe_shared) {
11643 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
11644#if CYTHON_AVOID_BORROWED_REFS
11645 CYTHON_UNUSED_VAR(boundscheck);
11646 Py_ssize_t wrapped_i = i;
11647 if (wraparound & unlikely(i < 0)) {
11648 Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(o);
11649 #if !CYTHON_ASSUME_SAFE_SIZE
11650 if (unlikely(size < 0)) return NULL;
11651 #endif
11652 wrapped_i += size;
11653 }
11654 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_COMPILING_IN_LIMITED_API
11655 return PySequence_ITEM(o, wrapped_i);
11656 #else
11657 if (unlikely(wrapped_i < 0)) {
11658 PyErr_SetString(PyExc_IndexError, "tuple index out of range");
11659 return NULL;
11660 }
11661 return PySequence_GetItem(o, wrapped_i);
11662 #endif
11663#elif CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
11664 Py_ssize_t wrapped_i = i;
11665 Py_ssize_t size = (wraparound | boundscheck) ? PyTuple_GET_SIZE(o) : -1;
11666 if (wraparound & unlikely(i < 0)) {
11667 wrapped_i += size;
11668 }
11669 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, size))) {
11670 return __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(o, wrapped_i));
11671 }
11672 return __Pyx_GetItemInt_Generic_size(o, i);
11673#else
11674 (void)wraparound;
11675 (void)boundscheck;
11676 return PySequence_GetItem(o, i);
11677#endif
11678}
11679#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
11680static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast_mapping(PyObject *o, binaryfunc getitem, Py_ssize_t i) {
11681 PyObject *r, *key = PyLong_FromSsize_t(i);
11682 if (unlikely(!key)) return NULL;
11683 r = getitem(o, key);
11684 Py_DECREF(key);
11685 return r;
11686}
11687#endif
11688static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
11689 int wraparound, int boundscheck, int unsafe_shared) {
11690 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
11691#if CYTHON_ASSUME_SAFE_SIZE
11692 if (PyList_CheckExact(o)) {
11693 return __Pyx_GetItemInt_List_Fast(o, i, wraparound, boundscheck, unsafe_shared);
11694 } else
11695 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11696 if (PyTuple_CheckExact(o)) {
11697 return __Pyx_GetItemInt_Tuple_Fast(o, i, wraparound, boundscheck, unsafe_shared);
11698 } else
11699 #endif
11700#else
11701 if ((!wraparound || i >= 0) & PyList_CheckExact(o)) {
11702 return boundscheck ? __Pyx_PyList_GetItemRef(o, i) : __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared);
11703 } else
11704#endif
11705#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
11706 if (PyDict_CheckExact(o)) {
11707 return __Pyx_GetItemInt_Fast_mapping(o, PyDict_Type.tp_as_mapping->mp_subscript, i);
11708 #if defined(PyFrozenDict_CheckExact)
11709 } else if (PyFrozenDict_CheckExact(o)) {
11710 return __Pyx_GetItemInt_Fast_mapping(o, PyFrozenDict_Type.tp_as_mapping->mp_subscript, i);
11711 #endif
11712 } else
11713 {
11714 PyTypeObject *obj_type = Py_TYPE(o);
11715 int seq_or_mapping = __Pyx_PyType_GetFlags(obj_type) & (Py_TPFLAGS_SEQUENCE|Py_TPFLAGS_MAPPING);
11716 if (seq_or_mapping != Py_TPFLAGS_SEQUENCE) {
11717 PyMappingMethods *mm = obj_type->tp_as_mapping;
11718 if (mm && mm->mp_subscript)
11719 return __Pyx_GetItemInt_Fast_mapping(o, mm->mp_subscript, i);
11720 }
11721 PySequenceMethods *sm = obj_type->tp_as_sequence;
11722 if (likely(sm && sm->sq_item)) {
11723 if (wraparound && (i < 0) && unlikely(__Pyx_GetItemInt_wraparound(o, sm, &i) == -1))
11724 return NULL;
11725 return sm->sq_item(o, i);
11726 }
11727 if (seq_or_mapping == Py_TPFLAGS_SEQUENCE) {
11728 PyMappingMethods *mm = obj_type->tp_as_mapping;
11729 if (likely(mm && mm->mp_subscript))
11730 return __Pyx_GetItemInt_Fast_mapping(o, mm->mp_subscript, i);
11731 }
11732 }
11733#else
11734 if (!PyMapping_Check(o)) {
11735 return PySequence_GetItem(o, i);
11736 }
11737#endif
11738 (void)wraparound;
11739 (void)boundscheck;
11740 return __Pyx_GetItemInt_Generic_size(o, i);
11741}
11742
11743/* RaiseErrorWithObjectType (used by ObjectGetItem) */
11744static void __Pyx_RaiseErrorWithType(PyObject* exc_type, const char* message, PyTypeObject *type_obj) {
11745 __Pyx_TypeName type_name = __Pyx_PyType_GetFullyQualifiedName(type_obj);
11746 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
11747 if (unlikely(!type_name)) return;
11748 #endif
11749 PyErr_Format(exc_type, message, type_name);
11750 __Pyx_DECREF_TypeName(type_name);
11751}
11752
11753/* ObjectGetItem */
11754#if CYTHON_USE_TYPE_SLOTS
11755static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) {
11756 PyObject *runerr = NULL;
11757 Py_ssize_t key_value;
11758 key_value = __Pyx_PyIndex_AsSsize_t(index);
11759 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
11760 return __Pyx_GetItemInt_Fast(obj, key_value, 1, 1, 1);
11761 }
11762 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
11763 PyErr_Clear();
11764 __Pyx_RaiseErrorWithObjectType(
11765 PyExc_IndexError,
11766 "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer",
11767 index);
11768 }
11769 return NULL;
11770}
11771static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) {
11772 if (likely(PyType_Check(obj))) {
11773 if ((PyTypeObject*)obj == &PyType_Type) {
11774 return Py_GenericAlias(obj, key);
11775 }
11776 PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_mstate_global->__pyx_n_u_class_getitem);
11777 if (!meth) {
11778 if (PyErr_Occurred()) {
11779 return NULL;
11780 }
11781 } else {
11782 PyObject *result = __Pyx_PyObject_CallOneArg(meth, key);
11783 Py_DECREF(meth);
11784 return result;
11785 }
11786 }
11787 __Pyx_RaiseTypeErrorWithObjectType(
11788 "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj);
11789 return NULL;
11790}
11791static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) {
11792 PyTypeObject *tp = Py_TYPE(obj);
11793 PyMappingMethods *mm = tp->tp_as_mapping;
11794 PySequenceMethods *sm = tp->tp_as_sequence;
11795 if (likely(mm && mm->mp_subscript)) {
11796 return mm->mp_subscript(obj, key);
11797 }
11798 if (likely(sm && sm->sq_item)) {
11799 return __Pyx_PyObject_GetIndex(obj, key);
11800 }
11801 return __Pyx_PyObject_GetItem_Slow(obj, key);
11802}
11803#endif
11804
11805/* pybytes_as_double (used by pynumber_float) */
11806static double __Pyx_SlowPyString_AsDouble(PyObject *obj) {
11807 PyObject *float_value = PyFloat_FromString(obj);
11808 if (likely(float_value)) {
11809 double value = __Pyx_PyFloat_AS_DOUBLE(float_value);
11810 Py_DECREF(float_value);
11811 return value;
11812 }
11813 return (double)-1;
11814}
11815static const char* __Pyx__PyBytes_AsDouble_Copy(const char* start, char* buffer, Py_ssize_t length) {
11816 int last_was_punctuation = 1;
11817 int parse_error_found = 0;
11818 Py_ssize_t i;
11819 for (i=0; i < length; i++) {
11820 char chr = start[i];
11821 int is_punctuation = (chr == '_') | (chr == '.') | (chr == 'e') | (chr == 'E');
11822 *buffer = chr;
11823 buffer += (chr != '_');
11824 parse_error_found |= last_was_punctuation & is_punctuation;
11825 last_was_punctuation = is_punctuation;
11826 }
11827 parse_error_found |= last_was_punctuation;
11828 *buffer = '\0';
11829 return unlikely(parse_error_found) ? NULL : buffer;
11830}
11831static double __Pyx__PyBytes_AsDouble_inf_nan(const char* start, Py_ssize_t length) {
11832 int matches = 1;
11833 char sign = start[0];
11834 int is_signed = (sign == '+') | (sign == '-');
11835 start += is_signed;
11836 length -= is_signed;
11837 switch (start[0]) {
11838 #ifdef Py_NAN
11839 case 'n':
11840 case 'N':
11841 if (unlikely(length != 3)) goto parse_failure;
11842 matches &= (start[1] == 'a' || start[1] == 'A');
11843 matches &= (start[2] == 'n' || start[2] == 'N');
11844 if (unlikely(!matches)) goto parse_failure;
11845 return (sign == '-') ? -Py_NAN : Py_NAN;
11846 #endif
11847 case 'i':
11848 case 'I':
11849 if (unlikely(length < 3)) goto parse_failure;
11850 matches &= (start[1] == 'n' || start[1] == 'N');
11851 matches &= (start[2] == 'f' || start[2] == 'F');
11852 if (likely(length == 3 && matches))
11853 return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
11854 if (unlikely(length != 8)) goto parse_failure;
11855 matches &= (start[3] == 'i' || start[3] == 'I');
11856 matches &= (start[4] == 'n' || start[4] == 'N');
11857 matches &= (start[5] == 'i' || start[5] == 'I');
11858 matches &= (start[6] == 't' || start[6] == 'T');
11859 matches &= (start[7] == 'y' || start[7] == 'Y');
11860 if (unlikely(!matches)) goto parse_failure;
11861 return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
11862 case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
11863 break;
11864 default:
11865 goto parse_failure;
11866 }
11867 return 0.0;
11868parse_failure:
11869 return -1.0;
11870}
11871static CYTHON_INLINE int __Pyx__PyBytes_AsDouble_IsSpace(char ch) {
11872 return (ch == 0x20) | !((ch < 0x9) | (ch > 0xd));
11873}
11874CYTHON_UNUSED static double __Pyx__PyBytes_AsDouble(PyObject *obj, const char* start, Py_ssize_t length) {
11875 double value;
11876 Py_ssize_t i, digits;
11877 const char *last = start + length;
11878 char *end;
11879 int valid_parse;
11880 while (__Pyx__PyBytes_AsDouble_IsSpace(*start))
11881 start++;
11882 while (start < last - 1 && __Pyx__PyBytes_AsDouble_IsSpace(last[-1]))
11883 last--;
11884 length = last - start;
11885 if (unlikely(length <= 0)) goto fallback;
11886 value = __Pyx__PyBytes_AsDouble_inf_nan(start, length);
11887 if (value != 0.0) {
11888 if (unlikely(value == -1.0)) goto fallback;
11889 return value;
11890 }
11891 digits = 0;
11892 for (i=0; i < length; digits += start[i++] != '_');
11893 if (likely(digits == length)) {
11894 value = PyOS_string_to_double(start, &end, NULL);
11895 valid_parse = (end == last);
11896 } else if (digits < 40) {
11897 char number[40];
11898 last = __Pyx__PyBytes_AsDouble_Copy(start, number, length);
11899 if (unlikely(!last)) goto fallback;
11900 value = PyOS_string_to_double(number, &end, NULL);
11901 valid_parse = (end == last);
11902 } else {
11903 char *number = (char*) PyMem_Malloc(((size_t) digits + 1) * sizeof(char));
11904 if (unlikely(!number)) goto fallback;
11905 last = __Pyx__PyBytes_AsDouble_Copy(start, number, length);
11906 if (unlikely(!last)) {
11907 PyMem_Free(number);
11908 goto fallback;
11909 }
11910 value = PyOS_string_to_double(number, &end, NULL);
11911 valid_parse = (end == last);
11912 PyMem_Free(number);
11913 }
11914 if (likely(valid_parse) || (value == (double)-1 && PyErr_Occurred())) {
11915 return value;
11916 }
11917fallback:
11918 return __Pyx_SlowPyString_AsDouble(obj);
11919}
11920
11921/* pynumber_float */
11922static CYTHON_INLINE PyObject* __Pyx__PyNumber_Float(PyObject* obj) {
11923 double val;
11924 if (PyLong_CheckExact(obj)) {
11925#if CYTHON_USE_PYLONG_INTERNALS
11926 if (likely(__Pyx_PyLong_IsCompact(obj))) {
11927 val = (double) __Pyx_PyLong_CompactValue(obj);
11928 goto no_error;
11929 }
11930#endif
11931 val = PyLong_AsDouble(obj);
11932 } else if (PyUnicode_CheckExact(obj)) {
11933 val = __Pyx_PyUnicode_AsDouble(obj);
11934 } else if (PyBytes_CheckExact(obj)) {
11935 val = __Pyx_PyBytes_AsDouble(obj);
11936 } else if (PyByteArray_CheckExact(obj)) {
11937 val = __Pyx_PyByteArray_AsDouble(obj);
11938 } else {
11939 return PyNumber_Float(obj);
11940 }
11941 if (unlikely(val == -1 && PyErr_Occurred())) {
11942 return NULL;
11943 }
11944#if CYTHON_USE_PYLONG_INTERNALS
11945no_error:
11946#endif
11947 return PyFloat_FromDouble(val);
11948}
11949
11950/* pybuiltin_invalid (used by pyfloat_simplify) */
11951static void __Pyx_PyBuiltin_Invalid(PyObject *obj, const char *builtin_type_name, const char *argname) {
11952 __Pyx_TypeName obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
11953 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
11954 if (unlikely(!obj_type_name)) return;
11955 #endif
11956 if (argname) {
11957 PyErr_Format(PyExc_TypeError,
11958 "Argument '%.200s' has incorrect type (expected %.5s, got " __Pyx_FMT_TYPENAME ")",
11959 argname, builtin_type_name, obj_type_name
11960 );
11961 } else {
11962 PyErr_Format(PyExc_TypeError,
11963 "Expected %.5s, got " __Pyx_FMT_TYPENAME,
11964 builtin_type_name, obj_type_name
11965 );
11966 }
11967 __Pyx_DECREF_TypeName(obj_type_name);
11968}
11969
11970/* pyfloat_simplify */
11971static int __Pyx__PyFloat_FromNumber(PyObject **number_var, const char *argname);
11972static CYTHON_INLINE int __Pyx_PyFloat_FromNumber(PyObject **number_var, const char *argname, int accept_none) {
11973 PyObject *number = *number_var;
11974 if (likely((accept_none && number == Py_None) || PyFloat_CheckExact(number))) {
11975 return 0;
11976 }
11977 return __Pyx__PyFloat_FromNumber(number_var, argname);
11978}
11979static int __Pyx__PyFloat_FromNumber(PyObject **number_var, const char *argname) {
11980 PyObject *number = *number_var;
11981 PyObject *float_object;
11982 if (likely(PyLong_CheckExact(number))) {
11983 double val;
11984#if CYTHON_USE_PYLONG_INTERNALS
11985 if (likely(__Pyx_PyLong_IsCompact(number))) {
11986 val = (double) __Pyx_PyLong_CompactValue(number);
11987 } else
11988#endif
11989 {
11990 val = PyLong_AsDouble(number);
11991 if (unlikely(val == -1.0 && PyErr_Occurred())) goto bad;
11992 }
11993 float_object = PyFloat_FromDouble(val);
11994 }
11995 else if (PyNumber_Check(number)) {
11996 float_object = PyNumber_Float(number);
11997 } else {
11998 __Pyx_PyBuiltin_Invalid(number, "float", argname);
11999 goto bad;
12000 }
12001 if (unlikely(!float_object)) goto bad;
12002 *number_var = float_object;
12003 Py_DECREF(number);
12004 return 0;
12005bad:
12006 *number_var = NULL;
12007 Py_DECREF(number);
12008 return -1;
12009}
12010
12011/* UnicodeEqualsUCS4 (used by UnicodeEquals_uchar) */
12012#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL)
12013static CYTHON_INLINE int __Pyx__PyUnicode_EqualsUCS4(PyObject* s1, Py_UCS4 ch2, int equals) {
12014 Py_ssize_t length;
12015 Py_UCS4 ch1;
12016 int kind;
12017 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0)) goto bad;
12018 length = __Pyx_PyUnicode_GET_LENGTH(s1);
12019 #if !CYTHON_ASSUME_SAFE_SIZE
12020 if (unlikely(length < 0)) goto bad;
12021 #endif
12022 if (length != 1) goto return_ne;
12023 kind = PyUnicode_KIND(s1);
12024 if (ch2 < 256) {
12025 if (likely(kind == PyUnicode_1BYTE_KIND)) {
12026 ch1 = PyUnicode_1BYTE_DATA(s1)[0];
12027 } else if (kind == PyUnicode_2BYTE_KIND) {
12028 ch1 = PyUnicode_2BYTE_DATA(s1)[0];
12029 } else {
12030 ch1 = PyUnicode_4BYTE_DATA(s1)[0];
12031 }
12032 } else if (ch2 < 65536) {
12033 if (kind == PyUnicode_2BYTE_KIND) {
12034 ch1 = PyUnicode_2BYTE_DATA(s1)[0];
12035 } else if (kind == PyUnicode_4BYTE_KIND) {
12036 ch1 = PyUnicode_4BYTE_DATA(s1)[0];
12037 } else {
12038 goto return_ne;
12039 }
12040 } else {
12041 if (kind == PyUnicode_4BYTE_KIND){
12042 ch1 = PyUnicode_4BYTE_DATA(s1)[0];
12043 } else {
12044 goto return_ne;
12045 }
12046 }
12047 if (ch1 == ch2) {
12048 goto return_eq;
12049 } else {
12050 goto return_ne;
12051 }
12052return_eq:
12053 return (equals == Py_EQ);
12054return_ne:
12055 return (equals == Py_NE);
12056bad:
12057 return -1;
12058}
12059#endif
12060
12061/* TypeImport */
12062#ifndef __PYX_HAVE_RT_ImportType_3_3_0
12063#define __PYX_HAVE_RT_ImportType_3_3_0
12064static PyTypeObject *__Pyx_ImportType_3_3_0(PyObject *module, const char *module_name, const char *class_name,
12065 size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_3_0 check_size)
12066{
12067 PyObject *result = 0;
12068 Py_ssize_t basicsize;
12069 Py_ssize_t itemsize;
12070#if defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API)
12071 PyObject *py_basicsize;
12072 PyObject *py_itemsize;
12073#endif
12074 result = PyObject_GetAttrString(module, class_name);
12075 if (!result)
12076 goto bad;
12077 if (!PyType_Check(result)) {
12078 PyErr_Format(PyExc_TypeError,
12079 "%.200s.%.200s is not a type object",
12080 module_name, class_name);
12081 goto bad;
12082 }
12083#if !( defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API) )
12084 basicsize = ((PyTypeObject *)result)->tp_basicsize;
12085 itemsize = ((PyTypeObject *)result)->tp_itemsize;
12086#else
12087 if (size == 0) {
12088 return (PyTypeObject *)result;
12089 }
12090 py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
12091 if (!py_basicsize)
12092 goto bad;
12093 basicsize = PyLong_AsSsize_t(py_basicsize);
12094 Py_DECREF(py_basicsize);
12095 py_basicsize = 0;
12096 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
12097 goto bad;
12098 py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
12099 if (!py_itemsize)
12100 goto bad;
12101 itemsize = PyLong_AsSsize_t(py_itemsize);
12102 Py_DECREF(py_itemsize);
12103 py_itemsize = 0;
12104 if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
12105 goto bad;
12106#endif
12107 if (itemsize) {
12108 if (size % alignment) {
12109 alignment = size % alignment;
12110 }
12111 if (itemsize < (Py_ssize_t)alignment)
12112 itemsize = (Py_ssize_t)alignment;
12113 }
12114 if ((size_t)(basicsize + itemsize) < size) {
12115 PyErr_Format(PyExc_ValueError,
12116 "%.200s.%.200s size changed, may indicate binary incompatibility. "
12117 "Expected %zd from C header, got %zd from PyObject",
12118 module_name, class_name, size, basicsize+itemsize);
12119 goto bad;
12120 }
12121 if (check_size == __Pyx_ImportType_CheckSize_Error_3_3_0 &&
12122 ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) {
12123 PyErr_Format(PyExc_ValueError,
12124 "%.200s.%.200s size changed, may indicate binary incompatibility. "
12125 "Expected %zd from C header, got %zd-%zd from PyObject",
12126 module_name, class_name, size, basicsize, basicsize+itemsize);
12127 goto bad;
12128 }
12129 else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_3_0 && (size_t)basicsize > size) {
12130 if (PyErr_WarnFormat(NULL, 0,
12131 "%.200s.%.200s size changed, may indicate binary incompatibility. "
12132 "Expected %zd from C header, got %zd from PyObject",
12133 module_name, class_name, size, basicsize) < 0) {
12134 goto bad;
12135 }
12136 }
12137 return (PyTypeObject *)result;
12138bad:
12139 Py_XDECREF(result);
12140 return NULL;
12141}
12142#endif
12143
12144/* HasAttr (used by ImportImpl) */
12145#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
12146static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
12147 PyObject *r;
12148 if (unlikely(!PyUnicode_Check(n))) {
12149 PyErr_SetString(PyExc_TypeError,
12150 "hasattr(): attribute name must be string");
12151 return -1;
12152 }
12153 r = __Pyx_PyObject_GetAttrStrNoError(o, n);
12154 if (!r) {
12155 return (unlikely(PyErr_Occurred())) ? -1 : 0;
12156 } else {
12157 Py_DECREF(r);
12158 return 1;
12159 }
12160}
12161#endif
12162
12163/* TupleOrListFromArrayImpl (used by ListFromArray) */
12164CYTHON_UNUSED static PyObject *
12165__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) {
12166 PyObject *res = PyList_New(n);
12167 if (unlikely(res == NULL)) return NULL;
12168 #if CYTHON_COMPILING_IN_CPYTHON
12169 __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
12170 #else
12171 Py_ssize_t i;
12172 for (i = 0; i < n; i++) {
12173 Py_INCREF(src[i]);
12174 if (unlikely(__Pyx_PyList_SET_ITEM(res, i, src[i]) < (0))) {
12175 Py_DECREF(res);
12176 return NULL;
12177 }
12178 }
12179 #endif
12180 return res;
12181}
12182
12183/* ImportImpl (used by Import) */
12184static int __Pyx__Import_GetModule(PyObject *qualname, PyObject **module) {
12185 PyObject *imported_module = PyImport_GetModule(qualname);
12186 if (unlikely(!imported_module)) {
12187 *module = NULL;
12188 if (PyErr_Occurred()) {
12189 return -1;
12190 }
12191 return 0;
12192 }
12193 *module = imported_module;
12194 return 1;
12195}
12196static int __Pyx__Import_Lookup(PyObject *qualname, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject **module) {
12197 PyObject *imported_module;
12198 PyObject *top_level_package_name;
12199 Py_ssize_t i;
12200 int status, module_found;
12201 Py_ssize_t dot_index;
12202 module_found = __Pyx__Import_GetModule(qualname, &imported_module);
12203 if (unlikely(!module_found || module_found == -1)) {
12204 *module = NULL;
12205 return module_found;
12206 }
12207 if (imported_names) {
12208 for (i = 0; i < len_imported_names; i++) {
12209 PyObject *imported_name = imported_names[i];
12210#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
12211 int has_imported_attribute = PyObject_HasAttr(imported_module, imported_name);
12212#else
12213 int has_imported_attribute = PyObject_HasAttrWithError(imported_module, imported_name);
12214 if (unlikely(has_imported_attribute == -1)) goto error;
12215#endif
12216 if (!has_imported_attribute) {
12217 goto not_found;
12218 }
12219 }
12220 *module = imported_module;
12221 return 1;
12222 }
12223 dot_index = PyUnicode_FindChar(qualname, '.', 0, PY_SSIZE_T_MAX, 1);
12224 if (dot_index == -1) {
12225 *module = imported_module;
12226 return 1;
12227 }
12228 if (unlikely(dot_index == -2)) goto error;
12229 top_level_package_name = PyUnicode_Substring(qualname, 0, dot_index);
12230 if (unlikely(!top_level_package_name)) goto error;
12231 Py_DECREF(imported_module);
12232 status = __Pyx__Import_GetModule(top_level_package_name, module);
12233 Py_DECREF(top_level_package_name);
12234 return status;
12235error:
12236 Py_DECREF(imported_module);
12237 *module = NULL;
12238 return -1;
12239not_found:
12240 Py_DECREF(imported_module);
12241 *module = NULL;
12242 return 0;
12243}
12244static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level) {
12245 PyObject *module = 0;
12246 PyObject *empty_dict = 0;
12247 PyObject *from_list = 0;
12248 int module_found;
12249 if (!qualname) {
12250 qualname = name;
12251 }
12252 module_found = __Pyx__Import_Lookup(qualname, imported_names, len_imported_names, &module);
12253 if (likely(module_found == 1)) {
12254 return module;
12255 } else if (unlikely(module_found == -1)) {
12256 return NULL;
12257 }
12258 #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030f00a6
12259 empty_dict = PyFrozenDict_New(NULL);
12260 #else
12261 empty_dict = PyDict_New();
12262 #endif
12263 if (unlikely(!empty_dict))
12264 goto bad;
12265 if (imported_names) {
12266 from_list = __Pyx_PyList_FromArray(imported_names, len_imported_names);
12267 if (unlikely(!from_list))
12268 goto bad;
12269 }
12270 if (level == -1) {
12271 const char* package_sep = strchr(__Pyx_MODULE_NAME, '.');
12272 if (package_sep != (0)) {
12273 module = PyImport_ImportModuleLevelObject(
12274 name, moddict, empty_dict, from_list, 1);
12275 if (unlikely(!module)) {
12276 if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
12277 goto bad;
12278 PyErr_Clear();
12279 }
12280 }
12281 level = 0;
12282 }
12283 if (!module) {
12284 module = PyImport_ImportModuleLevelObject(
12285 name, moddict, empty_dict, from_list, level);
12286 }
12287bad:
12288 Py_XDECREF(from_list);
12289 Py_XDECREF(empty_dict);
12290 return module;
12291}
12292
12293/* Import */
12294static PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level) {
12295 return __Pyx__Import(name, imported_names, len_imported_names, qualname, __pyx_mstate_global->__pyx_d, level);
12296}
12297
12298/* ImportFrom */
12299static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
12300 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
12301 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
12302 const char* module_name_str = 0;
12303 PyObject* module_name = 0;
12304 PyObject* module_dot = 0;
12305 PyObject* full_name = 0;
12306 PyErr_Clear();
12307 module_name_str = PyModule_GetName(module);
12308 if (unlikely(!module_name_str)) { goto modbad; }
12309 module_name = PyUnicode_FromString(module_name_str);
12310 if (unlikely(!module_name)) { goto modbad; }
12311 module_dot = PyUnicode_Concat(module_name, __pyx_mstate_global->__pyx_kp_u__3);
12312 if (unlikely(!module_dot)) { goto modbad; }
12313 full_name = PyUnicode_Concat(module_dot, name);
12314 if (unlikely(!full_name)) { goto modbad; }
12315 #if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) ||\
12316 CYTHON_COMPILING_IN_GRAAL
12317 {
12318 PyObject *modules = PyImport_GetModuleDict();
12319 if (unlikely(!modules))
12320 goto modbad;
12321 value = PyObject_GetItem(modules, full_name);
12322 }
12323 #else
12324 value = PyImport_GetModule(full_name);
12325 #endif
12326 modbad:
12327 Py_XDECREF(full_name);
12328 Py_XDECREF(module_dot);
12329 Py_XDECREF(module_name);
12330 }
12331 if (unlikely(!value)) {
12332 PyErr_Format(PyExc_ImportError, "cannot import name %S", name);
12333 }
12334 return value;
12335}
12336
12337/* dict_setdefault (used by FetchCommonType) */
12338static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value) {
12339 PyObject* value;
12340#if __PYX_LIMITED_VERSION_HEX >= 0x030F0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4)
12341 PyDict_SetDefaultRef(d, key, default_value, &value);
12342#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030C0000
12343 PyObject *args[] = {d, key, default_value};
12344 value = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_n_u_setdefault, args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
12345#elif CYTHON_COMPILING_IN_LIMITED_API
12346 value = PyObject_CallMethodObjArgs(d, __pyx_mstate_global->__pyx_n_u_setdefault, key, default_value, NULL);
12347#else
12348 value = PyDict_SetDefault(d, key, default_value);
12349 if (unlikely(!value)) return NULL;
12350 Py_INCREF(value);
12351#endif
12352 return value;
12353}
12354
12355/* AddModuleRef (used by FetchSharedCythonModule) */
12356#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX < 0x030F00a3
12357 static PyObject *__Pyx_PyImport_AddModuleObjectRef(PyObject *name) {
12358 PyObject *module_dict = PyImport_GetModuleDict();
12359 PyObject *m;
12360 if (PyMapping_GetOptionalItem(module_dict, name, &m) < 0) {
12361 return NULL;
12362 }
12363 if (m != NULL && PyModule_Check(m)) {
12364 return m;
12365 }
12366 Py_XDECREF(m);
12367 m = PyModule_NewObject(name);
12368 if (m == NULL)
12369 return NULL;
12370 if (PyDict_CheckExact(module_dict)) {
12371 PyObject *new_m;
12372 (void)PyDict_SetDefaultRef(module_dict, name, m, &new_m);
12373 Py_DECREF(m);
12374 return new_m;
12375 } else {
12376 if (PyObject_SetItem(module_dict, name, m) != 0) {
12377 Py_DECREF(m);
12378 return NULL;
12379 }
12380 return m;
12381 }
12382 }
12383 static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
12384 if ((PY_VERSION_HEX >= 0x030E0000) && Py_Version >= 0x030E0100) {
12385 return PyImport_AddModuleRef(name);
12386 }
12387 PyObject *py_name = PyUnicode_FromString(name);
12388 if (!py_name) return NULL;
12389 PyObject *module = __Pyx_PyImport_AddModuleObjectRef(py_name);
12390 Py_DECREF(py_name);
12391 return module;
12392 }
12393#elif __PYX_LIMITED_VERSION_HEX < 0x030d0000
12394 static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
12395 PyObject *module = PyImport_AddModule(name);
12396 Py_XINCREF(module);
12397 return module;
12398 }
12399#endif
12400
12401/* FetchSharedCythonModule (used by FetchCommonType) */
12402static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
12403 return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME);
12404}
12405
12406/* VerifyCachedType (used by FetchCommonType) */
12407static int __Pyx_VerifyCachedType(PyObject *cached_type,
12408 const char *name,
12409 Py_ssize_t expected_basicsize) {
12410 Py_ssize_t basicsize;
12411 if (!PyType_Check(cached_type)) {
12412 PyErr_Format(PyExc_TypeError,
12413 "Shared Cython type %.200s is not a type object", name);
12414 return -1;
12415 }
12416 if (expected_basicsize == 0) {
12417 return 0; // size is inherited, nothing useful to check
12418 }
12419#if CYTHON_COMPILING_IN_LIMITED_API && CYTHON_OPAQUE_OBJECTS
12420 if (expected_basicsize < 0) {
12421 basicsize = PyType_GetTypeDataSize((PyTypeObject*)cached_type);
12422 } else
12423#endif
12424 {
12425 #if CYTHON_COMPILING_IN_LIMITED_API
12426 PyObject *py_basicsize;
12427 py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
12428 if (unlikely(!py_basicsize)) return -1;
12429 basicsize = PyLong_AsSsize_t(py_basicsize);
12430 Py_DECREF(py_basicsize);
12431 py_basicsize = NULL;
12432 if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) return -1;
12433 #else
12434 basicsize = ((PyTypeObject*) cached_type)->tp_basicsize;
12435 #endif
12436 }
12437 if ((expected_basicsize >= 0) ?
12438 (basicsize != expected_basicsize) :
12439 (basicsize < -expected_basicsize)) {
12440 PyErr_Format(PyExc_TypeError,
12441 "Shared Cython type %.200s has the wrong size, try recompiling",
12442 name);
12443 return -1;
12444 }
12445 return 0;
12446}
12447
12448/* FetchCommonType (used by CommonTypesMetaclass) */
12449#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
12450static PyObject* __Pyx_PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
12451 PyObject *result = __Pyx_PyType_FromModuleAndSpec(module, spec, bases);
12452 if (result && metaclass) {
12453 PyObject *old_tp = (PyObject*)Py_TYPE(result);
12454 Py_INCREF((PyObject*)metaclass);
12455 Py_SET_TYPE(result, metaclass);
12456 Py_DECREF(old_tp);
12457 PyType_Modified((PyTypeObject*)result);
12458 }
12459 return result;
12460}
12461#else
12462#define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b)
12463#endif
12464static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
12465 PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name;
12466 int get_item_ref_result;
12467 const char* object_name = strrchr(spec->name, '.');
12468 object_name = object_name ? object_name+1 : spec->name;
12469 py_object_name = PyUnicode_FromString(object_name);
12470 if (!py_object_name) return NULL;
12471 abi_module = __Pyx_FetchSharedCythonABIModule();
12472 if (!abi_module) goto done;
12473 abi_module_dict = PyModule_GetDict(abi_module);
12474 if (!abi_module_dict) goto done;
12475 get_item_ref_result = __Pyx_PyDict_GetItemRef(abi_module_dict, py_object_name, &cached_type);
12476 if (get_item_ref_result == 1) {
12477 if (__Pyx_VerifyCachedType(
12478 cached_type,
12479 object_name,
12480 spec->basicsize) < 0) {
12481 goto bad;
12482 }
12483 goto done;
12484 } else if (unlikely(get_item_ref_result == -1)) {
12485 goto bad;
12486 }
12487 cached_type = __Pyx_PyType_FromMetaclass(
12488 metaclass,
12489 CYTHON_USE_MODULE_STATE ? module : abi_module,
12490 spec, bases);
12491 if (unlikely(!cached_type)) goto bad;
12492 new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type);
12493 if (unlikely(new_cached_type != cached_type)) {
12494 if (unlikely(!new_cached_type)) goto bad;
12495 Py_DECREF(cached_type);
12496 cached_type = new_cached_type;
12497 if (__Pyx_VerifyCachedType(
12498 cached_type,
12499 object_name,
12500 spec->basicsize) < 0) {
12501 goto bad;
12502 }
12503 goto done;
12504 } else {
12505 Py_DECREF(new_cached_type);
12506 }
12507done:
12508 Py_XDECREF(abi_module);
12509 Py_DECREF(py_object_name);
12510 assert(cached_type == NULL || PyType_Check(cached_type));
12511 return (PyTypeObject *) cached_type;
12512bad:
12513 Py_XDECREF(cached_type);
12514 cached_type = NULL;
12515 goto done;
12516}
12517
12518/* CommonTypesMetaclass (used by CythonFunctionShared) */
12519static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
12520 return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
12521}
12522#if __PYX_LIMITED_VERSION_HEX < 0x030A0000
12523static PyObject* __pyx_CommonTypesMetaclass_call(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *args, CYTHON_UNUSED PyObject *kwds) {
12524 PyErr_SetString(PyExc_TypeError, "Cannot instantiate Cython internal types");
12525 return NULL;
12526}
12527static int __pyx_CommonTypesMetaclass_setattr(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *attr, CYTHON_UNUSED PyObject *value) {
12528 PyErr_SetString(PyExc_TypeError, "Cython internal types are immutable");
12529 return -1;
12530}
12531#endif
12532static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
12533 {"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL},
12534 {0, 0, 0, 0, 0}
12535};
12536static PyType_Slot __pyx_CommonTypesMetaclass_slots[] = {
12537 {Py_tp_getset, (void *)__pyx_CommonTypesMetaclass_getset},
12538 #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
12539 {Py_tp_call, (void*)__pyx_CommonTypesMetaclass_call},
12540 {Py_tp_new, (void*)__pyx_CommonTypesMetaclass_call},
12541 {Py_tp_setattro, (void*)__pyx_CommonTypesMetaclass_setattr},
12542 #endif
12543 {0, 0}
12544};
12545static PyType_Spec __pyx_CommonTypesMetaclass_spec = {
12546 __PYX_TYPE_MODULE_PREFIX "_common_types_metatype",
12547 0,
12548 0,
12549 Py_TPFLAGS_IMMUTABLETYPE |
12550 Py_TPFLAGS_DISALLOW_INSTANTIATION |
12551 Py_TPFLAGS_DEFAULT,
12552 __pyx_CommonTypesMetaclass_slots
12553};
12554static int __pyx_CommonTypesMetaclass_init(PyObject *module) {
12555 __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
12556 PyObject *bases = PyTuple_Pack(1, &PyType_Type);
12557 if (unlikely(!bases)) {
12558 return -1;
12559 }
12560 mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases);
12561 Py_DECREF(bases);
12562 if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) {
12563 return -1;
12564 }
12565 return 0;
12566}
12567
12568/* CythonFunctionPerModule (used by CythonFunctionShared) */
12569#if CYTHON_COMPILING_IN_LIMITED_API
12570static CYTHON_INLINE int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func, void (*cfunc)(void)) {
12571 if (__Pyx_CyFunction_Check(func)) {
12572 return __Pyx_as_CyFunctionObject(func)->func_methoddef->ml_meth == (PyCFunction) cfunc;
12573 } else if (PyCFunction_Check(func)) {
12574 return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
12575 }
12576 return 0;
12577}
12578static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
12579 if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) {
12580 int result;
12581 PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func);
12582 if (unlikely(!newFunc)) {
12583 PyErr_Clear(); // It's only an optimization, so don't throw an error
12584 return 0;
12585 }
12586 result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc);
12587 Py_DECREF(newFunc);
12588 return result;
12589 }
12590 return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc);
12591}
12592#else
12593static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
12594 if (PyMethod_Check(func)) {
12595 func = PyMethod_GET_FUNCTION(func);
12596 }
12597 return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
12598}
12599#endif
12600static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
12601#if CYTHON_COMPILING_IN_LIMITED_API
12602 __Pyx_Py_XDECREF_SET(
12603 __Pyx__CyFunction_GetClassObj(f),
12604 ((classobj) ? __Pyx_NewRef(classobj) : NULL));
12605#else
12606 __Pyx_Py_XDECREF_SET(
12607 ((PyCMethodObject *) (f))->mm_class,
12608 (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
12609#endif
12610}
12611static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) {
12612 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
12613 m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL); // _PyObject_New(defaults_type);
12614 if (unlikely(!m->defaults))
12615 return NULL;
12616 return m->defaults;
12617}
12618static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
12619 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
12620 m->defaults_tuple = tuple;
12621 Py_INCREF(tuple);
12622}
12623static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
12624 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
12625 m->defaults_kwdict = dict;
12626 Py_INCREF(dict);
12627}
12628static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
12629 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
12630 m->func_annotations = dict;
12631 Py_INCREF(dict);
12632}
12633
12634/* CallTypeTraverse (used by CythonFunctionShared) */
12635#if !CYTHON_USE_TYPE_SPECS
12636#else
12637static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg) {
12638 if (!always_call) {
12639 PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*);
12640 unsigned long flags = PyType_GetFlags(base);
12641 if (flags & Py_TPFLAGS_HEAPTYPE) {
12642 return 0;
12643 }
12644 }
12645 Py_VISIT((PyObject*)Py_TYPE(o));
12646 return 0;
12647}
12648#endif
12649
12650/* PyMethodNew (used by CythonFunctionShared) */
12651#if CYTHON_COMPILING_IN_LIMITED_API
12652static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
12653 PyObject *result;
12654 CYTHON_UNUSED_VAR(typ);
12655 if (!self)
12656 return __Pyx_NewRef(func);
12657 #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
12658 {
12659 PyObject *args[] = {func, self};
12660 result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL);
12661 }
12662 #else
12663 result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL);
12664 #endif
12665 return result;
12666}
12667#else
12668static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
12669 CYTHON_UNUSED_VAR(typ);
12670 if (!self)
12671 return __Pyx_NewRef(func);
12672 return PyMethod_New(func, self);
12673}
12674#endif
12675
12676/* PyVectorcallFastCallDict (used by CythonFunctionShared) */
12677#if CYTHON_VECTORCALL
12678static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
12679{
12680 PyObject *res = NULL;
12681 PyObject *kwnames;
12682 PyObject **newargs;
12683 PyObject **kwvalues;
12684 Py_ssize_t i;
12685 #if CYTHON_AVOID_BORROWED_REFS
12686 PyObject *pos;
12687 #else
12688 Py_ssize_t pos;
12689 #endif
12690 size_t j;
12691 PyObject *key, *value;
12692 unsigned long keys_are_strings;
12693 #if !CYTHON_ASSUME_SAFE_SIZE
12694 Py_ssize_t nkw = PyDict_Size(kw);
12695 if (unlikely(nkw == -1)) return NULL;
12696 #else
12697 Py_ssize_t nkw = PyDict_GET_SIZE(kw);
12698 #endif
12699 newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0]));
12700 if (unlikely(newargs == NULL)) {
12701 PyErr_NoMemory();
12702 return NULL;
12703 }
12704 for (j = 0; j < nargs; j++) newargs[j] = args[j];
12705 kwnames = PyTuple_New(nkw);
12706 if (unlikely(kwnames == NULL)) {
12707 PyMem_Free(newargs);
12708 return NULL;
12709 }
12710 kwvalues = newargs + nargs;
12711 pos = 0;
12712 i = 0;
12713 keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
12714 while (__Pyx_PyDict_NextRef(kw, &pos, &key, &value)) {
12715 keys_are_strings &=
12716 #if CYTHON_COMPILING_IN_LIMITED_API
12717 PyType_GetFlags(Py_TYPE(key));
12718 #else
12719 Py_TYPE(key)->tp_flags;
12720 #endif
12721 #if !CYTHON_ASSUME_SAFE_MACROS
12722 if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0)) goto cleanup;
12723 #else
12724 PyTuple_SET_ITEM(kwnames, i, key);
12725 #endif
12726 kwvalues[i] = value;
12727 i++;
12728 }
12729 if (unlikely(!keys_are_strings)) {
12730 PyErr_SetString(PyExc_TypeError, "keywords must be strings");
12731 goto cleanup;
12732 }
12733 res = vc(func, newargs, nargs, kwnames);
12734cleanup:
12735 #if CYTHON_AVOID_BORROWED_REFS
12736 Py_DECREF(pos);
12737 #endif
12738 Py_DECREF(kwnames);
12739 for (i = 0; i < nkw; i++)
12740 Py_DECREF(kwvalues[i]);
12741 PyMem_Free(newargs);
12742 return res;
12743}
12744static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
12745{
12746 Py_ssize_t kw_size =
12747 likely(kw == NULL) ?
12748 0 :
12749#if !CYTHON_ASSUME_SAFE_SIZE
12750 PyDict_Size(kw);
12751#else
12752 PyDict_GET_SIZE(kw);
12753#endif
12754 if (kw_size == 0) {
12755 return vc(func, args, nargs, NULL);
12756 }
12757#if !CYTHON_ASSUME_SAFE_SIZE
12758 else if (unlikely(kw_size == -1)) {
12759 return NULL;
12760 }
12761#endif
12762 return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
12763}
12764#endif
12765
12766/* CythonFunctionShared (used by CythonFunction) */
12767static PyObject *
12768__Pyx_CyFunction_get_doc_locked(__pyx_CyFunctionObject *op)
12769{
12770 if (unlikely(op->func_doc == NULL)) {
12771#if CYTHON_COMPILING_IN_LIMITED_API
12772 const char *doc = op->func_methoddef->ml_doc;
12773#else
12774 const char *doc = ((PyCFunctionObject*)op)->m_ml->ml_doc;
12775#endif
12776 if (doc) {
12777 op->func_doc = PyUnicode_FromString(doc);
12778 if (unlikely(op->func_doc == NULL))
12779 return NULL;
12780 } else {
12781 Py_INCREF(Py_None);
12782 return Py_None;
12783 }
12784 }
12785 Py_INCREF(op->func_doc);
12786 return op->func_doc;
12787}
12788static PyObject *
12789__Pyx_CyFunction_get_doc(PyObject *op_in, void *closure) {
12790 PyObject *result;
12791 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
12792 CYTHON_UNUSED_VAR(closure);
12793 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
12794 result = __Pyx_CyFunction_get_doc_locked(op);
12795 __Pyx_END_CRITICAL_SECTION();
12796 return result;
12797}
12798static int
12799__Pyx_CyFunction_set_doc(PyObject *op_in, PyObject *value, void *context)
12800{
12801 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
12802 CYTHON_UNUSED_VAR(context);
12803 if (value == NULL) {
12804 value = Py_None;
12805 }
12806 Py_INCREF(value);
12807 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
12808 __Pyx_Py_XDECREF_SET(op->func_doc, value);
12809 __Pyx_END_CRITICAL_SECTION();
12810 return 0;
12811}
12812static PyObject *
12813__Pyx_CyFunction_get_name_locked(__pyx_CyFunctionObject *op)
12814{
12815 if (unlikely(op->func_name == NULL)) {
12816#if CYTHON_COMPILING_IN_LIMITED_API
12817 const char *name = op->func_methoddef->ml_name;
12818#else
12819 const char *name = ((PyCFunctionObject*)op)->m_ml->ml_name;
12820#endif
12821 op->func_name = PyUnicode_InternFromString(name);
12822 if (unlikely(op->func_name == NULL))
12823 return NULL;
12824 }
12825 Py_INCREF(op->func_name);
12826 return op->func_name;
12827}
12828static PyObject *
12829__Pyx_CyFunction_get_name(PyObject *op, void *context)
12830{
12831 PyObject *result = NULL;
12832 CYTHON_UNUSED_VAR(context);
12833 __Pyx_BEGIN_CRITICAL_SECTION(op);
12834 result = __Pyx_CyFunction_get_name_locked(__Pyx_as_CyFunctionObject(op));
12835 __Pyx_END_CRITICAL_SECTION();
12836 return result;
12837}
12838static int
12839__Pyx_CyFunction_set_name(PyObject *op_in, PyObject *value, void *context)
12840{
12841 CYTHON_UNUSED_VAR(context);
12842 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
12843 PyErr_SetString(PyExc_TypeError,
12844 "__name__ must be set to a string object");
12845 return -1;
12846 }
12847 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
12848 Py_INCREF(value);
12849 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
12850 __Pyx_Py_XDECREF_SET(op->func_name, value);
12851 __Pyx_END_CRITICAL_SECTION();
12852 return 0;
12853}
12854static PyObject *
12855__Pyx_CyFunction_get_qualname(PyObject *op_in, void *context)
12856{
12857 CYTHON_UNUSED_VAR(context);
12858 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
12859 PyObject *result;
12860 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
12861 Py_INCREF(op->func_qualname);
12862 result = op->func_qualname;
12863 __Pyx_END_CRITICAL_SECTION();
12864 return result;
12865}
12866static int
12867__Pyx_CyFunction_set_qualname(PyObject *op_in, PyObject *value, void *context)
12868{
12869 CYTHON_UNUSED_VAR(context);
12870 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
12871 PyErr_SetString(PyExc_TypeError,
12872 "__qualname__ must be set to a string object");
12873 return -1;
12874 }
12875 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
12876 Py_INCREF(value);
12877 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
12878 __Pyx_Py_XDECREF_SET(op->func_qualname, value);
12879 __Pyx_END_CRITICAL_SECTION();
12880 return 0;
12881}
12882#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
12883static PyObject *
12884__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
12885{
12886 CYTHON_UNUSED_VAR(context);
12887 if (unlikely(op->func_dict == NULL)) {
12888 op->func_dict = PyDict_New();
12889 if (unlikely(op->func_dict == NULL))
12890 return NULL;
12891 }
12892 Py_INCREF(op->func_dict);
12893 return op->func_dict;
12894}
12895#endif
12896static PyObject *
12897__Pyx_CyFunction_get_globals(PyObject *op_in, void *context)
12898{
12899 CYTHON_UNUSED_VAR(context);
12900 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
12901 Py_INCREF(op->func_globals);
12902 return op->func_globals;
12903}
12904static PyObject *
12905__Pyx_CyFunction_get_closure(PyObject *op, void *context)
12906{
12907 CYTHON_UNUSED_VAR(op);
12908 CYTHON_UNUSED_VAR(context);
12909 Py_INCREF(Py_None);
12910 return Py_None;
12911}
12912static PyObject *
12913__Pyx_CyFunction_get_code(PyObject *op_in, void *context)
12914{
12915 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
12916 PyObject* result = (op->func_code) ? op->func_code : Py_None;
12917 CYTHON_UNUSED_VAR(context);
12918 Py_INCREF(result);
12919 return result;
12920}
12921static int
12922__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op, PyObject *op_obj) {
12923 int result = 0;
12924 PyObject *res = op->defaults_getter(op_obj);
12925 if (unlikely(!res))
12926 return -1;
12927 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12928 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
12929 Py_INCREF(op->defaults_tuple);
12930 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
12931 Py_INCREF(op->defaults_kwdict);
12932 #else
12933 op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
12934 if (unlikely(!op->defaults_tuple)) result = -1;
12935 else {
12936 op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
12937 if (unlikely(!op->defaults_kwdict)) result = -1;
12938 }
12939 #endif
12940 Py_DECREF(res);
12941 return result;
12942}
12943static int
12944__Pyx_CyFunction_set_defaults(PyObject *op_in, PyObject* value, void *context) {
12945 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
12946 CYTHON_UNUSED_VAR(context);
12947 if (!value) {
12948 value = Py_None;
12949 } else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
12950 PyErr_SetString(PyExc_TypeError,
12951 "__defaults__ must be set to a tuple object");
12952 return -1;
12953 }
12954 PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not "
12955 "currently affect the values used in function calls", 1);
12956 Py_INCREF(value);
12957 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
12958 __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
12959 __Pyx_END_CRITICAL_SECTION();
12960 return 0;
12961}
12962static PyObject *
12963__Pyx_CyFunction_get_defaults_locked(PyObject *op_in) {
12964 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
12965 PyObject* result = op->defaults_tuple;
12966 if (unlikely(!result)) {
12967 if (op->defaults_getter) {
12968 if (unlikely(__Pyx_CyFunction_init_defaults(op, op_in) < 0)) return NULL;
12969 result = op->defaults_tuple;
12970 } else {
12971 result = Py_None;
12972 }
12973 }
12974 Py_INCREF(result);
12975 return result;
12976}
12977static PyObject *
12978__Pyx_CyFunction_get_defaults(PyObject *op, void *context) {
12979 PyObject* result = NULL;
12980 CYTHON_UNUSED_VAR(context);
12981 __Pyx_BEGIN_CRITICAL_SECTION(op);
12982 result = __Pyx_CyFunction_get_defaults_locked(op);
12983 __Pyx_END_CRITICAL_SECTION();
12984 return result;
12985}
12986static int
12987__Pyx_CyFunction_set_kwdefaults(PyObject *op_in, PyObject* value, void *context) {
12988 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
12989 CYTHON_UNUSED_VAR(context);
12990 if (!value) {
12991 value = Py_None;
12992 } else if (unlikely(value != Py_None && !PyDict_Check(value))) {
12993 PyErr_SetString(PyExc_TypeError,
12994 "__kwdefaults__ must be set to a dict object");
12995 return -1;
12996 }
12997 PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not "
12998 "currently affect the values used in function calls", 1);
12999 Py_INCREF(value);
13000 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
13001 __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
13002 __Pyx_END_CRITICAL_SECTION();
13003 return 0;
13004}
13005static PyObject *
13006__Pyx_CyFunction_get_kwdefaults_locked(PyObject *op_in) {
13007 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
13008 PyObject* result = op->defaults_kwdict;
13009 if (unlikely(!result)) {
13010 if (op->defaults_getter) {
13011 if (unlikely(__Pyx_CyFunction_init_defaults(op, op_in) < 0)) return NULL;
13012 result = op->defaults_kwdict;
13013 } else {
13014 result = Py_None;
13015 }
13016 }
13017 Py_INCREF(result);
13018 return result;
13019}
13020static PyObject *
13021__Pyx_CyFunction_get_kwdefaults(PyObject *op, void *context) {
13022 PyObject* result;
13023 CYTHON_UNUSED_VAR(context);
13024 __Pyx_BEGIN_CRITICAL_SECTION(op);
13025 result = __Pyx_CyFunction_get_kwdefaults_locked(op);
13026 __Pyx_END_CRITICAL_SECTION();
13027 return result;
13028}
13029static int __Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value);
13030static int
13031__Pyx_CyFunction_set_annotations(PyObject *op_in, PyObject* value, void *context) {
13032 CYTHON_UNUSED_VAR(context);
13033 if (!value || value == Py_None) {
13034 value = NULL;
13035 } else if (unlikely(!PyDict_Check(value))) {
13036 PyErr_SetString(PyExc_TypeError,
13037 "__annotations__ must be set to a dict object");
13038 return -1;
13039 }
13040 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
13041 Py_XINCREF(value);
13042 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
13043 __Pyx_Py_XDECREF_SET(op->func_annotations, value);
13044 __Pyx_END_CRITICAL_SECTION();
13045 if (unlikely(__Pyx_CyFunction_set_annotate_in_dict_if_exists(op_in, Py_None) < 0)) return -1;
13046 return 0;
13047}
13048static int
13049__Pyx_CyFunction_get_dict_if_exists(PyObject *op_in, PyObject **dict) {
13050 /* Return 1 if the function dict exists, 0 otherwise. This cannot fail:
13051 * _PyObject_GetDictPtr() may clear errors internally, but never reports them. */
13052#if CYTHON_COMPILING_IN_PYPY
13053 *dict = PyObject_GenericGetDict(op_in, NULL);
13054#elif CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030C0000
13055 *dict = __Pyx_as_CyFunctionObject(op_in)->func_dict;
13056#else
13057 PyObject **dictptr = _PyObject_GetDictPtr(op_in);
13058 *dict = likely(dictptr) ? *dictptr : NULL;
13059#endif
13060 return *dict ? 1 : 0;
13061}
13062static int
13063__Pyx_CyFunction_get_annotate_from_dict_if_exists(PyObject *op_in, PyObject **annotate) {
13064 PyObject *dict;
13065 int dict_found;
13066 *annotate = NULL;
13067 dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
13068 if (!dict_found) return 0;
13069 return __Pyx_PyDict_GetItemRef(dict, __pyx_mstate_global->__pyx_n_u_annotate, annotate);
13070}
13071static int
13072__Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value) {
13073 PyObject *dict;
13074 int dict_found;
13075 dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
13076 if (!dict_found) return 0;
13077 if (value) {
13078 return PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
13079 } else {
13080#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
13081 return PyDict_Pop(dict, __pyx_mstate_global->__pyx_n_u_annotate, NULL);
13082#else
13083 int result = PyDict_Contains(dict, __pyx_mstate_global->__pyx_n_u_annotate);
13084 if (result == 1) {
13085 result = PyDict_DelItem(dict, __pyx_mstate_global->__pyx_n_u_annotate);
13086 }
13087 return result;
13088#endif
13089 }
13090}
13091static int
13092__Pyx_CyFunction_set_annotate_in_dict(PyObject *op_in, PyObject *value) {
13093 PyObject *dict;
13094 int result;
13095#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
13096 dict = __Pyx_CyFunction_get_dict(__Pyx_as_CyFunctionObject(op_in), NULL);
13097#else
13098 dict = PyObject_GenericGetDict(op_in, NULL);
13099#endif
13100 if (unlikely(!dict)) return -1;
13101 result = PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
13102 Py_DECREF(dict);
13103 return result;
13104}
13105static PyObject *
13106__Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) {
13107 PyObject* result = op->func_annotations;
13108 if (unlikely(!result)) {
13109 result = PyDict_New();
13110 if (unlikely(!result)) return NULL;
13111 op->func_annotations = result;
13112 }
13113 Py_INCREF(result);
13114 return result;
13115}
13116static PyObject *
13117__Pyx_CyFunction_get_annotations(PyObject *op_in, void *context) {
13118 PyObject *annotate = NULL;
13119 PyObject *result = NULL;
13120 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
13121 CYTHON_UNUSED_VAR(context);
13122 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
13123 result = __Pyx_XNewRef(op->func_annotations);
13124 __Pyx_END_CRITICAL_SECTION();
13125 if (result) return result;
13126 if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0)) return NULL;
13127 if (!annotate || annotate == Py_None) {
13128 Py_XDECREF(annotate);
13129 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
13130 result = __Pyx_CyFunction_get_annotations_locked(op);
13131 __Pyx_END_CRITICAL_SECTION();
13132 return result;
13133 }
13134 PyObject *format = PyLong_FromLong(1L); // annotationlib.Format.VALUE
13135 if (likely(format)) {
13136 if (!Py_EnterRecursiveCall(" cyfunction __annotations__.__get__")) {
13137 result = __Pyx_PyObject_CallOneArg(annotate, format);
13138 Py_LeaveRecursiveCall();
13139 Py_DECREF(format);
13140 }
13141 }
13142 Py_DECREF(annotate);
13143 if (unlikely(!result)) return NULL;
13144 if (unlikely(!PyDict_Check(result))) {
13145 PyErr_SetString(PyExc_TypeError, "__annotate__ must return a dict");
13146 Py_DECREF(result);
13147 return NULL;
13148 }
13149 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
13150 __Pyx_Py_XDECREF_SET(op->func_annotations, __Pyx_NewRef(result));
13151 __Pyx_END_CRITICAL_SECTION();
13152 return result;
13153}
13154static PyObject *__Pyx_CyFunction_annotate_impl(PyObject *self, PyObject *arg) {
13155 CYTHON_UNUSED_VAR(arg);
13156 if (unlikely(!self)) {
13157 PyErr_SetString(PyExc_SystemError, "cython __annotate__ called without 'self' argument");
13158 return NULL;
13159 }
13160 PyObject *result;
13161 if (Py_EnterRecursiveCall(" in cyfunction annotate")) {
13162 return NULL;
13163 }
13164 result = __Pyx_CyFunction_get_annotations(self, NULL);
13165 Py_LeaveRecursiveCall();
13166 return result;
13167}
13168static PyObject *
13169__Pyx_CyFunction_get_annotate(PyObject *op_in, void *context);
13170static int
13171__Pyx_CyFunction_set_annotate(PyObject *op_in, PyObject* value, void *context) {
13172 CYTHON_UNUSED_VAR(context);
13173 if (value == NULL) {
13174 PyErr_SetString(PyExc_TypeError, "__annotate__ cannot be deleted");
13175 return -1;
13176 }
13177 if (unlikely(value != Py_None && !PyCallable_Check(value))) {
13178 PyErr_SetString(PyExc_TypeError, "__annotate__ must be callable or None");
13179 return -1;
13180 }
13181 if (unlikely(__Pyx_TypeCheck(value, &PyCFunction_Type))) {
13182#if !CYTHON_ASSUME_SAFE_MACROS && !CYTHON_COMPILING_IN_PYPY
13183 PyCFunction cfunction = PyCFunction_GetFunction(value);
13184 if (unlikely(!cfunction)) return -1;
13185 PyObject *value_self = PyCFunction_GetSelf(value);
13186 if (unlikely(!value_self && PyErr_Occurred())) return -1;
13187#else
13188 PyCFunction cfunction = PyCFunction_GET_FUNCTION(value);
13189 PyObject *value_self = PyCFunction_GET_SELF(value);
13190#endif
13191 if (cfunction == __Pyx_CyFunction_annotate_impl && value_self == op_in) {
13192 return __Pyx_CyFunction_set_annotate_in_dict_if_exists(op_in, NULL);
13193 }
13194 }
13195 if (value != Py_None) {
13196 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
13197 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
13198 Py_CLEAR(op->func_annotations);
13199 __Pyx_END_CRITICAL_SECTION();
13200 }
13201 return __Pyx_CyFunction_set_annotate_in_dict(op_in, value);
13202}
13203#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
13204static PyObject *
13205__Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) {
13206 int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
13207 if (is_coroutine) {
13208 PyObject *is_coroutine_value, *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_is_coroutine;
13209 fromlist = PyList_New(1);
13210 if (unlikely(!fromlist)) return NULL;
13211 Py_INCREF(marker);
13212#if CYTHON_ASSUME_SAFE_MACROS
13213 PyList_SET_ITEM(fromlist, 0, marker);
13214#else
13215 if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
13216 Py_DECREF(fromlist);
13217 return NULL;
13218 }
13219#endif
13220 module = PyImport_ImportModuleLevelObject(__pyx_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0);
13221 Py_DECREF(fromlist);
13222 if (unlikely(!module)) {
13223 goto ignore_or_error;
13224 }
13225 is_coroutine_value = __Pyx_PyObject_GetAttrStr(module, marker);
13226 Py_DECREF(module);
13227 if (likely(is_coroutine_value)) {
13228 return is_coroutine_value;
13229 }
13230ignore_or_error:
13231 if (!__Pyx_IgnoreException(PyExc_Exception)) {
13232 return NULL;
13233 }
13234 }
13235 return __Pyx_PyBool_FromLong(is_coroutine);
13236}
13237static PyObject *
13238__Pyx_CyFunction_get_is_coroutine(PyObject *op_in, void *context) {
13239 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
13240 PyObject *result;
13241 CYTHON_UNUSED_VAR(context);
13242 if (op->func_is_coroutine) {
13243 return __Pyx_NewRef(op->func_is_coroutine);
13244 }
13245 result = __Pyx_CyFunction_get_is_coroutine_value(op);
13246 if (unlikely(!result))
13247 return NULL;
13248 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
13249 if (op->func_is_coroutine) {
13250 Py_DECREF(result);
13251 result = __Pyx_NewRef(op->func_is_coroutine);
13252 } else {
13253 op->func_is_coroutine = __Pyx_NewRef(result);
13254 }
13255 __Pyx_END_CRITICAL_SECTION();
13256 return result;
13257}
13258#endif
13259static void __Pyx_CyFunction_raise_argument_count_error(PyObject *func, const char* message, Py_ssize_t size) {
13260#if CYTHON_COMPILING_IN_LIMITED_API
13261 PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
13262 if (!py_name) return;
13263 PyErr_Format(PyExc_TypeError,
13264 "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T "d given)",
13265 py_name, message, size);
13266 Py_DECREF(py_name);
13267#else
13268 const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
13269 PyErr_Format(PyExc_TypeError,
13270 "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T "d given)",
13271 name, message, size);
13272#endif
13273}
13274static void __Pyx_CyFunction_raise_type_error(PyObject *func, const char* message) {
13275#if CYTHON_COMPILING_IN_LIMITED_API
13276 PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
13277 if (!py_name) return;
13278 PyErr_Format(PyExc_TypeError,
13279 "%.200S() %s",
13280 py_name, message);
13281 Py_DECREF(py_name);
13282#else
13283 const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
13284 PyErr_Format(PyExc_TypeError,
13285 "%.200s() %s",
13286 name, message);
13287#endif
13288}
13289#if CYTHON_COMPILING_IN_LIMITED_API
13290static PyObject *
13291__Pyx_CyFunction_get_module(PyObject *op_in, void *context) {
13292 CYTHON_UNUSED_VAR(context);
13293 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
13294 Py_INCREF(op->func_module);
13295 return op->func_module;
13296}
13297static int
13298__Pyx_CyFunction_set_module(PyObject *op_in, PyObject* value, void *context) {
13299 CYTHON_UNUSED_VAR(context);
13300 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
13301 if (value == NULL) {
13302 value = Py_None;
13303 }
13304 Py_INCREF(value);
13305 PyObject *old = op->func_module;
13306 op->func_module = value;
13307 Py_DECREF(old);
13308 return 0;
13309}
13310#endif
13311static PyGetSetDef __pyx_CyFunction_getsets[] = {
13312 {"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
13313 {"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
13314 {"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
13315 {"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
13316 {"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
13317#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
13318 {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
13319 {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
13320#else
13321 {"func_dict", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
13322 {"__dict__", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
13323#endif
13324 {"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
13325 {"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
13326 {"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
13327 {"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
13328 {"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
13329 {"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
13330 {"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
13331 {"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
13332 {"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
13333 {"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
13334 {"__annotate__", (getter)__Pyx_CyFunction_get_annotate, (setter)__Pyx_CyFunction_set_annotate, 0, 0},
13335#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
13336 {"_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
13337#endif
13338#if CYTHON_COMPILING_IN_LIMITED_API
13339 {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
13340#endif
13341 {0, 0, 0, 0, 0}
13342};
13343static PyMemberDef __pyx_CyFunction_members[] = {
13344#if !CYTHON_COMPILING_IN_LIMITED_API
13345 {"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
13346#endif
13347#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
13348 {"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict),
13349 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
13350#endif
13351#if CYTHON_VECTORCALL
13352#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
13353 {"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall),
13354 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
13355#else
13356 {"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
13357#endif
13358#if CYTHON_COMPILING_IN_LIMITED_API
13359 {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist),
13360 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
13361#else
13362 {"__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
13363#endif
13364#endif
13365 {0, 0, 0, 0, 0}
13366};
13367static PyObject *
13368__Pyx_CyFunction_reduce(PyObject *m_in, PyObject *args)
13369{
13370 PyObject *result = NULL;
13371 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(m_in);
13372 CYTHON_UNUSED_VAR(args);
13373 __Pyx_BEGIN_CRITICAL_SECTION(m_in);
13374 Py_INCREF(m->func_qualname);
13375 result = m->func_qualname;
13376 __Pyx_END_CRITICAL_SECTION();
13377 return result;
13378}
13379static PyMethodDef __pyx_CyFunction_methods[] = {
13380 {"__annotate_cython__", __Pyx_CyFunction_annotate_impl, METH_O,
13381 "Placeholder __annotate__ function to allow 'functools.wraps' to work "
13382 "on Cython functions."},
13383 {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_NOARGS, 0},
13384 {0, 0, 0, 0}
13385};
13386static PyObject *
13387__Pyx_CyFunction_get_annotate(PyObject *op_in, void *context) {
13388 PyObject *annotate = NULL;
13389 CYTHON_UNUSED_VAR(context);
13390 if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0)) return NULL;
13391 if (annotate) return annotate;
13392 PyObject *method = PyCFunction_New(
13393 &__pyx_CyFunction_methods[0],
13394 op_in);
13395 return method;
13396}
13397#if CYTHON_COMPILING_IN_LIMITED_API
13398#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
13399#else
13400#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
13401#endif
13402static PyObject *__Pyx_CyFunction_Init(PyObject *op_in,
13403 PyMethodDef *ml, int flags, PyObject* qualname,
13404 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
13405 __pyx_CyFunctionObject* op = __Pyx_as_CyFunctionObject(op_in);
13406#if !CYTHON_COMPILING_IN_LIMITED_API
13407 PyCFunctionObject *cf = (PyCFunctionObject*) op;
13408#endif
13409 if (unlikely(op == NULL))
13410 return NULL;
13411#if CYTHON_COMPILING_IN_LIMITED_API
13412 op->func_methoddef = ml;
13413 Py_INCREF(module);
13414 op->func_module = module;
13415#endif
13416 op->flags = flags;
13417 __Pyx_CyFunction_weakreflist(op) = NULL;
13418#if !CYTHON_COMPILING_IN_LIMITED_API
13419 cf->m_ml = ml;
13420 cf->m_self = (PyObject *) op;
13421#endif
13422 Py_XINCREF(closure);
13423 op->func_closure = closure;
13424#if !CYTHON_COMPILING_IN_LIMITED_API
13425 Py_XINCREF(module);
13426 cf->m_module = module;
13427#endif
13428#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
13429 op->func_dict = NULL;
13430#endif
13431 op->func_name = NULL;
13432 Py_INCREF(qualname);
13433 op->func_qualname = qualname;
13434 op->func_doc = NULL;
13435#if CYTHON_COMPILING_IN_LIMITED_API
13436 op->func_classobj = NULL;
13437#else
13438 ((PyCMethodObject*)op)->mm_class = NULL;
13439#endif
13440 op->func_globals = globals;
13441 Py_INCREF(op->func_globals);
13442 Py_XINCREF(code);
13443 op->func_code = code;
13444 op->defaults = NULL;
13445 op->defaults_tuple = NULL;
13446 op->defaults_kwdict = NULL;
13447 op->defaults_getter = NULL;
13448 op->func_annotations = NULL;
13449#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
13450 op->func_is_coroutine = NULL;
13451#endif
13452#if CYTHON_VECTORCALL
13453 switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
13454 case METH_NOARGS:
13455 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
13456 break;
13457 case METH_O:
13458 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
13459 break;
13460 case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
13461 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
13462 break;
13463 case METH_FASTCALL | METH_KEYWORDS:
13464 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
13465 break;
13466 case METH_VARARGS | METH_KEYWORDS:
13467 __Pyx_CyFunction_func_vectorcall(op) = NULL;
13468 break;
13469 default:
13470 PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
13471 Py_DECREF(op_in);
13472 return NULL;
13473 }
13474#endif
13475 return op_in;
13476}
13477static int __Pyx__CyFunction_clear(__pyx_CyFunctionObject *m)
13478{
13479 Py_CLEAR(m->func_closure);
13480#if CYTHON_COMPILING_IN_LIMITED_API
13481 Py_CLEAR(m->func_module);
13482#else
13483 Py_CLEAR(((PyCFunctionObject*)m)->m_module);
13484#endif
13485#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
13486 Py_CLEAR(m->func_dict);
13487#elif PY_VERSION_HEX < 0x030d0000
13488 _PyObject_ClearManagedDict((PyObject*)m);
13489#else
13490 PyObject_ClearManagedDict((PyObject*)m);
13491#endif
13492 Py_CLEAR(m->func_name);
13493 Py_CLEAR(m->func_qualname);
13494 Py_CLEAR(m->func_doc);
13495 Py_CLEAR(m->func_globals);
13496 Py_CLEAR(m->func_code);
13497#if CYTHON_COMPILING_IN_LIMITED_API
13498 Py_CLEAR(m->func_classobj);
13499#else
13500 {
13501 PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
13502 ((PyCMethodObject *) (m))->mm_class = NULL;
13503 Py_XDECREF(cls);
13504 }
13505#endif
13506 Py_CLEAR(m->defaults_tuple);
13507 Py_CLEAR(m->defaults_kwdict);
13508 Py_CLEAR(m->func_annotations);
13509#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
13510 Py_CLEAR(m->func_is_coroutine);
13511#endif
13512 Py_CLEAR(m->defaults);
13513 return 0;
13514}
13515static int
13516__Pyx_CyFunction_clear(PyObject *m)
13517{
13518 return __Pyx__CyFunction_clear(__Pyx_as_CyFunctionObject(m));
13519}
13520static void __Pyx__CyFunction_dealloc(PyObject *m)
13521{
13522 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(m);
13523 if (__Pyx_CyFunction_weakreflist(cyfunc) != NULL)
13524 PyObject_ClearWeakRefs(m);
13525 __Pyx__CyFunction_clear(cyfunc);
13526 __Pyx_PyHeapTypeObject_GC_Del(m);
13527}
13528static void __Pyx_CyFunction_dealloc(PyObject *m)
13529{
13530 PyObject_GC_UnTrack(m);
13531 __Pyx__CyFunction_dealloc(m);
13532}
13533static int __Pyx_CyFunction_traverse(PyObject *m_in, visitproc visit, void *arg)
13534{
13535 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(m_in);
13536 {
13537 int e = __Pyx_call_type_traverse(m_in, 1, visit, arg);
13538 if (e) return e;
13539 }
13540 Py_VISIT(m->func_closure);
13541#if CYTHON_COMPILING_IN_LIMITED_API
13542 Py_VISIT(m->func_module);
13543#else
13544 Py_VISIT(((PyCFunctionObject*)m)->m_module);
13545#endif
13546#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
13547 Py_VISIT(m->func_dict);
13548#else
13549 {
13550 int e =
13551#if PY_VERSION_HEX < 0x030d0000
13552 _PyObject_VisitManagedDict
13553#else
13554 PyObject_VisitManagedDict
13555#endif
13556 ((PyObject*)m, visit, arg);
13557 if (e != 0) return e;
13558 }
13559#endif
13560 __Pyx_VISIT_CONST(m->func_name);
13561 __Pyx_VISIT_CONST(m->func_qualname);
13562 Py_VISIT(m->func_doc);
13563 Py_VISIT(m->func_globals);
13564 __Pyx_VISIT_CONST(m->func_code);
13565 Py_VISIT(__Pyx__CyFunction_GetClassObj(m));
13566 Py_VISIT(m->defaults_tuple);
13567 Py_VISIT(m->defaults_kwdict);
13568 Py_VISIT(m->func_annotations);
13569#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
13570 Py_VISIT(m->func_is_coroutine);
13571#endif
13572 Py_VISIT(m->defaults);
13573 return 0;
13574}
13575static PyObject*
13576__Pyx_CyFunction_repr(PyObject *op_in)
13577{
13578 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
13579 PyObject *repr;
13580 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
13581 repr = PyUnicode_FromFormat("<cyfunction %U at %p>",
13582 op->func_qualname, (void *)op);
13583 __Pyx_END_CRITICAL_SECTION();
13584 return repr;
13585}
13586static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
13587#if CYTHON_COMPILING_IN_LIMITED_API
13588 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
13589 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
13590 int flags = cyfunc->func_methoddef->ml_flags;
13591#else
13592 PyCFunctionObject* f = (PyCFunctionObject*)func;
13593 PyCFunction meth = f->m_ml->ml_meth;
13594 int flags = f->m_ml->ml_flags;
13595#endif
13596 Py_ssize_t size;
13597 switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
13598 case METH_VARARGS:
13599 if (likely(kw == NULL || PyDict_Size(kw) == 0))
13600 return (*meth)(self, arg);
13601 break;
13602 case METH_VARARGS | METH_KEYWORDS:
13603 return (*(PyCFunctionWithKeywords)(void(*)(void))meth)(self, arg, kw);
13604 case METH_NOARGS:
13605 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
13606#if CYTHON_ASSUME_SAFE_SIZE
13607 size = PyTuple_GET_SIZE(arg);
13608#else
13609 size = PyTuple_Size(arg);
13610 if (unlikely(size < 0)) return NULL;
13611#endif
13612 if (likely(size == 0))
13613 return (*meth)(self, NULL);
13614 __Pyx_CyFunction_raise_argument_count_error(
13615 func,
13616 "takes no arguments", size);
13617 return NULL;
13618 }
13619 break;
13620 case METH_O:
13621 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
13622#if CYTHON_ASSUME_SAFE_SIZE
13623 size = PyTuple_GET_SIZE(arg);
13624#else
13625 size = PyTuple_Size(arg);
13626 if (unlikely(size < 0)) return NULL;
13627#endif
13628 if (likely(size == 1)) {
13629 PyObject *result, *arg0;
13630 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13631 arg0 = PyTuple_GET_ITEM(arg, 0);
13632 #else
13633 arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
13634 #endif
13635 result = (*meth)(self, arg0);
13636 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
13637 Py_DECREF(arg0);
13638 #endif
13639 return result;
13640 }
13641 __Pyx_CyFunction_raise_argument_count_error(
13642 func,
13643 "takes exactly one argument", size);
13644 return NULL;
13645 }
13646 break;
13647 default:
13648 PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
13649 return NULL;
13650 }
13651 __Pyx_CyFunction_raise_type_error(
13652 func, "takes no keyword arguments");
13653 return NULL;
13654}
13655static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
13656 PyObject *result;
13657 result = __Pyx_CyFunction_CallMethod(func, func, arg, kw);
13658 return result;
13659}
13660static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
13661 PyObject *result;
13662 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
13663#if CYTHON_VECTORCALL
13664 __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
13665 if (vc) {
13666#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
13667 return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw);
13668#else
13669 (void) &__Pyx_PyVectorcall_FastCallDict;
13670 return PyVectorcall_Call(func, args, kw);
13671#endif
13672 }
13673#endif
13674 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
13675 Py_ssize_t argc;
13676 PyObject *new_args;
13677 PyObject *self;
13678#if CYTHON_ASSUME_SAFE_SIZE
13679 argc = PyTuple_GET_SIZE(args);
13680#else
13681 argc = PyTuple_Size(args);
13682 if (unlikely(argc < 0)) return NULL;
13683#endif
13684 new_args = PyTuple_GetSlice(args, 1, argc);
13685 if (unlikely(!new_args))
13686 return NULL;
13687 self = PyTuple_GetItem(args, 0);
13688 if (unlikely(!self)) {
13689 Py_DECREF(new_args);
13690 PyErr_Format(PyExc_TypeError,
13691 "unbound method %.200S() needs an argument",
13692 cyfunc->func_qualname);
13693 return NULL;
13694 }
13695 result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
13696 Py_DECREF(new_args);
13697 } else {
13698 result = __Pyx_CyFunction_Call(func, args, kw);
13699 }
13700 return result;
13701}
13702#if CYTHON_VECTORCALL
13703static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(PyObject *func, __pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
13704{
13705 int ret = 0;
13706 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
13707 if (unlikely(nargs < 1)) {
13708 __Pyx_CyFunction_raise_type_error(
13709 func, "needs an argument");
13710 return -1;
13711 }
13712 ret = 1;
13713 }
13714 if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) {
13715 __Pyx_CyFunction_raise_type_error(
13716 func, "takes no keyword arguments");
13717 return -1;
13718 }
13719 return ret;
13720}
13721static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
13722{
13723 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
13724 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
13725 PyObject *self;
13726#if CYTHON_COMPILING_IN_LIMITED_API
13727 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
13728 if (unlikely(!meth)) return NULL;
13729#else
13730 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
13731#endif
13732 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, kwnames)) {
13733 case 1:
13734 self = args[0];
13735 args += 1;
13736 nargs -= 1;
13737 break;
13738 case 0:
13739 self = func;
13740 break;
13741 default:
13742 return NULL;
13743 }
13744 if (unlikely(nargs != 0)) {
13745 __Pyx_CyFunction_raise_argument_count_error(
13746 func, "takes no arguments", nargs);
13747 return NULL;
13748 }
13749 return meth(self, NULL);
13750}
13751static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
13752{
13753 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
13754 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
13755 PyObject *self;
13756#if CYTHON_COMPILING_IN_LIMITED_API
13757 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
13758 if (unlikely(!meth)) return NULL;
13759#else
13760 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
13761#endif
13762 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, kwnames)) {
13763 case 1:
13764 self = args[0];
13765 args += 1;
13766 nargs -= 1;
13767 break;
13768 case 0:
13769 self = func;
13770 break;
13771 default:
13772 return NULL;
13773 }
13774 if (unlikely(nargs != 1)) {
13775 __Pyx_CyFunction_raise_argument_count_error(
13776 func, "takes exactly one argument", nargs);
13777 return NULL;
13778 }
13779 return meth(self, args[0]);
13780}
13781static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
13782{
13783 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
13784 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
13785 PyObject *self;
13786#if CYTHON_COMPILING_IN_LIMITED_API
13787 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
13788 if (unlikely(!meth)) return NULL;
13789#else
13790 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
13791#endif
13792 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, NULL)) {
13793 case 1:
13794 self = args[0];
13795 args += 1;
13796 nargs -= 1;
13797 break;
13798 case 0:
13799 self = func;
13800 break;
13801 default:
13802 return NULL;
13803 }
13804 return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))meth)(self, args, nargs, kwnames);
13805}
13806static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
13807{
13808 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
13809 PyTypeObject *cls = (PyTypeObject *) __Pyx__CyFunction_GetClassObj(cyfunc);
13810 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
13811 PyObject *self;
13812#if CYTHON_COMPILING_IN_LIMITED_API
13813 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
13814 if (unlikely(!meth)) return NULL;
13815#else
13816 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
13817#endif
13818 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, NULL)) {
13819 case 1:
13820 self = args[0];
13821 args += 1;
13822 nargs -= 1;
13823 break;
13824 case 0:
13825 self = func;
13826 break;
13827 default:
13828 return NULL;
13829 }
13830 #if PY_VERSION_HEX < 0x030e00A6
13831 size_t nargs_value = (size_t) nargs;
13832 #else
13833 Py_ssize_t nargs_value = nargs;
13834 #endif
13835 return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, nargs_value, kwnames);
13836}
13837#endif
13838static PyType_Slot __pyx_CyFunctionType_slots[] = {
13839 {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc},
13840 {Py_tp_repr, (void *)__Pyx_CyFunction_repr},
13841 {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod},
13842 {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse},
13843 {Py_tp_clear, (void *)__Pyx_CyFunction_clear},
13844 {Py_tp_methods, (void *)__pyx_CyFunction_methods},
13845 {Py_tp_members, (void *)__pyx_CyFunction_members},
13846 {Py_tp_getset, (void *)__pyx_CyFunction_getsets},
13847 {Py_tp_descr_get, (void *)__Pyx_PyMethod_New},
13848 {0, 0},
13849};
13850static PyType_Spec __pyx_CyFunctionType_spec = {
13851 __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
13852 __PYX_SHARED_SIZEOF(__pyx_CyFunctionObject),
13853 0,
13854#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
13855 Py_TPFLAGS_METHOD_DESCRIPTOR |
13856#endif
13857#if CYTHON_VECTORCALL
13858#if defined(Py_TPFLAGS_HAVE_VECTORCALL)
13859 Py_TPFLAGS_HAVE_VECTORCALL |
13860#elif defined(_Py_TPFLAGS_HAVE_VECTORCALL)
13861 _Py_TPFLAGS_HAVE_VECTORCALL |
13862#endif
13863#endif // CYTHON_VECTORCALL
13864#if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API
13865 Py_TPFLAGS_MANAGED_DICT |
13866#endif
13867 Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION |
13868 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
13869 __pyx_CyFunctionType_slots
13870};
13871static int __pyx_CyFunction_init(PyObject *module) {
13872 __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
13873 mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(
13874 mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_CyFunctionType_spec, NULL);
13875 if (unlikely(mstate->__pyx_CyFunctionType == NULL)) {
13876 return -1;
13877 }
13878 return 0;
13879}
13880
13881/* CythonFunction */
13882static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
13883 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
13884 (void)&__Pyx_Get_CyFunction_Type;
13885 PyObject *op = __Pyx_CyFunction_Init(
13886 PyObject_GC_New(PyObject, __pyx_mstate_global->__pyx_CyFunctionType),
13887 ml, flags, qualname, closure, module, globals, code
13888 );
13889 if (likely(op)) {
13890 PyObject_GC_Track(op);
13891 }
13892 return op;
13893}
13894static PyTypeObject *__Pyx_Get_CyFunction_Type(void) {
13895 PyTypeObject *tp = __pyx_mstate_global->__pyx_CyFunctionType;
13896 Py_INCREF((PyObject*)tp);
13897 return tp;
13898}
13899
13900/* CLineInTraceback (used by AddTraceback) */
13901#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
13902#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
13903#define __Pyx_PyProbablyModule_GetDict(o) __Pyx_XNewRef(PyModule_GetDict(o))
13904#elif !CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
13905#define __Pyx_PyProbablyModule_GetDict(o) PyObject_GenericGetDict(o, NULL);
13906#else
13907PyObject* __Pyx_PyProbablyModule_GetDict(PyObject *o) {
13908 PyObject **dict_ptr = _PyObject_GetDictPtr(o);
13909 return dict_ptr ? __Pyx_XNewRef(*dict_ptr) : NULL;
13910}
13911#endif
13912static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
13913 PyObject *use_cline = NULL;
13914 PyObject *ptype, *pvalue, *ptraceback;
13915 PyObject *cython_runtime_dict;
13916 CYTHON_MAYBE_UNUSED_VAR(tstate);
13917 if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) {
13918 return c_line;
13919 }
13920 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
13921 cython_runtime_dict = __Pyx_PyProbablyModule_GetDict(__pyx_mstate_global->__pyx_cython_runtime);
13922 if (likely(cython_runtime_dict)) {
13923 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
13924 use_cline, cython_runtime_dict,
13925 __Pyx_PyDict_SetDefault(cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False))
13926 }
13927 if (use_cline == NULL || use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
13928 c_line = 0;
13929 }
13930 Py_XDECREF(use_cline);
13931 Py_XDECREF(cython_runtime_dict);
13932 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
13933 return c_line;
13934}
13935#endif
13936
13937/* CodeObjectCache (used by AddTraceback) */
13938static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
13939 int start = 0, mid = 0, end = count - 1;
13940 if (end >= 0 && code_line > entries[end].code_line) {
13941 return count;
13942 }
13943 while (start < end) {
13944 mid = start + (end - start) / 2;
13945 if (code_line < entries[mid].code_line) {
13946 end = mid;
13947 } else if (code_line > entries[mid].code_line) {
13948 start = mid + 1;
13949 } else {
13950 return mid;
13951 }
13952 }
13953 if (code_line <= entries[mid].code_line) {
13954 return mid;
13955 } else {
13956 return mid + 1;
13957 }
13958}
13959static __Pyx_CachedCodeObjectType *__pyx__find_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line) {
13960 __Pyx_CachedCodeObjectType* code_object;
13961 int pos;
13962 if (unlikely(!code_line) || unlikely(!code_cache->entries)) {
13963 return NULL;
13964 }
13965 pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
13966 if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) {
13967 return NULL;
13968 }
13969 code_object = code_cache->entries[pos].code_object;
13970 Py_INCREF(code_object);
13971 return code_object;
13972}
13973static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line) {
13974#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
13975 (void)__pyx__find_code_object;
13976 return NULL; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just miss.
13977#else
13978 struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
13979#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
13980 __pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count);
13981 if (old_count < 0) {
13982 __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
13983 return NULL;
13984 }
13985#endif
13986 __Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line);
13987#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
13988 __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
13989#endif
13990 return result;
13991#endif
13992}
13993static void __pyx__insert_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line, __Pyx_CachedCodeObjectType* code_object)
13994{
13995 int pos, i;
13996 __Pyx_CodeObjectCacheEntry* entries = code_cache->entries;
13997 if (unlikely(!code_line)) {
13998 return;
13999 }
14000 if (unlikely(!entries)) {
14001 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
14002 if (likely(entries)) {
14003 code_cache->entries = entries;
14004 code_cache->max_count = 64;
14005 code_cache->count = 1;
14006 entries[0].code_line = code_line;
14007 entries[0].code_object = code_object;
14008 Py_INCREF(code_object);
14009 }
14010 return;
14011 }
14012 pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
14013 if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) {
14014 __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object;
14015 entries[pos].code_object = code_object;
14016 Py_INCREF(code_object);
14017 Py_DECREF(tmp);
14018 return;
14019 }
14020 if (code_cache->count == code_cache->max_count) {
14021 int new_max = code_cache->max_count + 64;
14022 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
14023 code_cache->entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
14024 if (unlikely(!entries)) {
14025 return;
14026 }
14027 code_cache->entries = entries;
14028 code_cache->max_count = new_max;
14029 }
14030 for (i=code_cache->count; i>pos; i--) {
14031 entries[i] = entries[i-1];
14032 }
14033 entries[pos].code_line = code_line;
14034 entries[pos].code_object = code_object;
14035 code_cache->count++;
14036 Py_INCREF(code_object);
14037}
14038static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object) {
14039#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
14040 (void)__pyx__insert_code_object;
14041 return; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just fail.
14042#else
14043 struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
14044#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
14045 __pyx_nonatomic_int_type expected = 0;
14046 if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) {
14047 return;
14048 }
14049#endif
14050 __pyx__insert_code_object(code_cache, code_line, code_object);
14051#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
14052 __pyx_atomic_sub(&code_cache->accessor_count, INT_MIN);
14053#endif
14054#endif
14055}
14056
14057/* AddTraceback */
14058#include "compile.h"
14059#include "frameobject.h"
14060#include "traceback.h"
14061#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
14062 #ifndef Py_BUILD_CORE
14063 #define Py_BUILD_CORE 1
14064 #endif
14065 #include "internal/pycore_frame.h"
14066#endif
14067#if CYTHON_COMPILING_IN_LIMITED_API
14068static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
14069 PyObject *firstlineno, PyObject *name) {
14070 PyObject *replace = NULL;
14071 if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
14072 if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
14073 replace = PyObject_GetAttrString(code, "replace");
14074 if (likely(replace)) {
14075 PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict);
14076 Py_DECREF(replace);
14077 return result;
14078 }
14079 return NULL;
14080}
14081static void __Pyx_AddTraceback(const char *funcname, int c_line,
14082 int py_line, const char *filename) {
14083 PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
14084 PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
14085 PyObject *exc_type, *exc_value, *exc_traceback;
14086 int success = 0;
14087 if (c_line) {
14088 c_line = __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
14089 }
14090 __Pyx_PyErr_FetchException(&exc_type, &exc_value, &exc_traceback);
14091 code_object = __pyx_find_code_object(c_line ? -c_line : py_line);
14092 if (!code_object) {
14093 code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
14094 if (unlikely(!code_object)) goto bad;
14095 py_py_line = PyLong_FromLong(py_line);
14096 if (unlikely(!py_py_line)) goto bad;
14097 if (c_line) {
14098 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
14099 } else {
14100 py_funcname = PyUnicode_FromString(funcname);
14101 }
14102 if (unlikely(!py_funcname)) goto bad;
14103 dict = PyDict_New();
14104 if (unlikely(!dict)) goto bad;
14105 {
14106 PyObject *old_code_object = code_object;
14107 code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
14108 Py_DECREF(old_code_object);
14109 }
14110 if (unlikely(!code_object)) goto bad;
14111 __pyx_insert_code_object(c_line ? -c_line : py_line, code_object);
14112 } else {
14113 dict = PyDict_New();
14114 }
14115 getframe = PySys_GetObject("_getframe");
14116 if (unlikely(!getframe)) goto bad;
14117 if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
14118 frame = PyEval_EvalCode(code_object, dict, dict);
14119 if (unlikely(!frame) || frame == Py_None) goto bad;
14120 success = 1;
14121 bad:
14122 __Pyx_PyErr_RestoreException(exc_type, exc_value, exc_traceback);
14123 Py_XDECREF(code_object);
14124 Py_XDECREF(py_py_line);
14125 Py_XDECREF(py_funcname);
14126 Py_XDECREF(dict);
14127 Py_XDECREF(replace);
14128 if (success) {
14129 PyTraceBack_Here(
14130 (struct _frame*)frame);
14131 }
14132 Py_XDECREF(frame);
14133}
14134#else
14135static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
14136 const char *funcname, int c_line,
14137 int py_line, const char *filename) {
14138 PyCodeObject *py_code = NULL;
14139 PyObject *py_funcname = NULL;
14140 if (c_line) {
14141 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
14142 if (!py_funcname) goto bad;
14143 funcname = PyUnicode_AsUTF8(py_funcname);
14144 if (!funcname) goto bad;
14145 }
14146 py_code = PyCode_NewEmpty(filename, funcname, py_line);
14147 Py_XDECREF(py_funcname);
14148 return py_code;
14149bad:
14150 Py_XDECREF(py_funcname);
14151 return NULL;
14152}
14153static void __Pyx_AddTraceback(const char *funcname, int c_line,
14154 int py_line, const char *filename) {
14155 PyCodeObject *py_code = 0;
14156 PyFrameObject *py_frame = 0;
14157 PyThreadState *tstate = __Pyx_PyThreadState_Current;
14158 PyObject *ptype, *pvalue, *ptraceback;
14159 if (c_line) {
14160 c_line = __Pyx_CLineForTraceback(tstate, c_line);
14161 }
14162 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
14163 if (!py_code) {
14164 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
14165 py_code = __Pyx_CreateCodeObjectForTraceback(
14166 funcname, c_line, py_line, filename);
14167 if (!py_code) {
14168 /* If the code object creation fails, then we should clear the
14169 fetched exception references and propagate the new exception */
14170 Py_XDECREF(ptype);
14171 Py_XDECREF(pvalue);
14172 Py_XDECREF(ptraceback);
14173 goto bad;
14174 }
14175 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
14176 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
14177 }
14178 py_frame = PyFrame_New(
14179 tstate, /*PyThreadState *tstate,*/
14180 py_code, /*PyCodeObject *code,*/
14181 __pyx_mstate_global->__pyx_d, /*PyObject *globals,*/
14182 0 /*PyObject *locals*/
14183 );
14184 if (!py_frame) goto bad;
14185 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
14186 PyTraceBack_Here(py_frame);
14187bad:
14188 Py_XDECREF(py_code);
14189 Py_XDECREF(py_frame);
14190}
14191#endif
14192
14193/* Declarations */
14194#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
14195 #ifdef __cplusplus
14196 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
14197 return ::std::complex< float >(x, y);
14198 }
14199 #else
14200 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
14201 return x + y*(__pyx_t_float_complex)_Complex_I;
14202 }
14203 #endif
14204#else
14205 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
14206 __pyx_t_float_complex z;
14207 z.real = x;
14208 z.imag = y;
14209 return z;
14210 }
14211#endif
14212
14213/* Arithmetic */
14214#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
14215#else
14216 static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
14217 return (a.real == b.real) && (a.imag == b.imag);
14218 }
14219 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
14220 __pyx_t_float_complex z;
14221 z.real = a.real + b.real;
14222 z.imag = a.imag + b.imag;
14223 return z;
14224 }
14225 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
14226 __pyx_t_float_complex z;
14227 z.real = a.real - b.real;
14228 z.imag = a.imag - b.imag;
14229 return z;
14230 }
14231 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
14232 __pyx_t_float_complex z;
14233 z.real = a.real * b.real - a.imag * b.imag;
14234 z.imag = a.real * b.imag + a.imag * b.real;
14235 return z;
14236 }
14237 #if 1
14238 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
14239 if (b.imag == 0) {
14240 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
14241 } else if (fabsf(b.real) >= fabsf(b.imag)) {
14242 if (b.real == 0 && b.imag == 0) {
14243 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
14244 } else {
14245 float r = b.imag / b.real;
14246 float s = (float)(1.0) / (b.real + b.imag * r);
14247 return __pyx_t_float_complex_from_parts(
14248 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
14249 }
14250 } else {
14251 float r = b.real / b.imag;
14252 float s = (float)(1.0) / (b.imag + b.real * r);
14253 return __pyx_t_float_complex_from_parts(
14254 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
14255 }
14256 }
14257 #else
14258 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
14259 if (b.imag == 0) {
14260 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
14261 } else {
14262 float denom = b.real * b.real + b.imag * b.imag;
14263 return __pyx_t_float_complex_from_parts(
14264 (a.real * b.real + a.imag * b.imag) / denom,
14265 (a.imag * b.real - a.real * b.imag) / denom);
14266 }
14267 }
14268 #endif
14269 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
14270 __pyx_t_float_complex z;
14271 z.real = -a.real;
14272 z.imag = -a.imag;
14273 return z;
14274 }
14275 static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
14276 return (a.real == 0) && (a.imag == 0);
14277 }
14278 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
14279 __pyx_t_float_complex z;
14280 z.real = a.real;
14281 z.imag = -a.imag;
14282 return z;
14283 }
14284 #if 1
14285 static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
14286 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
14287 return sqrtf(z.real*z.real + z.imag*z.imag);
14288 #else
14289 return hypotf(z.real, z.imag);
14290 #endif
14291 }
14292 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
14293 __pyx_t_float_complex z;
14294 float r, lnr, theta, z_r, z_theta;
14295 if (b.imag == 0 && b.real == (int)b.real) {
14296 if (b.real < 0) {
14297 float denom = a.real * a.real + a.imag * a.imag;
14298 a.real = a.real / denom;
14299 a.imag = -a.imag / denom;
14300 b.real = -b.real;
14301 }
14302 switch ((int)b.real) {
14303 case 0:
14304 z.real = 1;
14305 z.imag = 0;
14306 return z;
14307 case 1:
14308 return a;
14309 case 2:
14310 return __Pyx_c_prod_float(a, a);
14311 case 3:
14312 z = __Pyx_c_prod_float(a, a);
14313 return __Pyx_c_prod_float(z, a);
14314 case 4:
14315 z = __Pyx_c_prod_float(a, a);
14316 return __Pyx_c_prod_float(z, z);
14317 }
14318 }
14319 if (a.imag == 0) {
14320 if (a.real == 0) {
14321 return a;
14322 } else if ((b.imag == 0) && (a.real >= 0)) {
14323 z.real = powf(a.real, b.real);
14324 z.imag = 0;
14325 return z;
14326 } else if (a.real > 0) {
14327 r = a.real;
14328 theta = 0;
14329 } else {
14330 r = -a.real;
14331 theta = atan2f(0.0, -1.0);
14332 }
14333 } else {
14334 r = __Pyx_c_abs_float(a);
14335 theta = atan2f(a.imag, a.real);
14336 }
14337 lnr = logf(r);
14338 z_r = expf(lnr * b.real - theta * b.imag);
14339 z_theta = theta * b.real + lnr * b.imag;
14340 z.real = z_r * cosf(z_theta);
14341 z.imag = z_r * sinf(z_theta);
14342 return z;
14343 }
14344 #endif
14345#endif
14346
14347/* Declarations */
14348#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
14349 #ifdef __cplusplus
14350 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
14351 return ::std::complex< double >(x, y);
14352 }
14353 #else
14354 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
14355 return x + y*(__pyx_t_double_complex)_Complex_I;
14356 }
14357 #endif
14358#else
14359 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
14360 __pyx_t_double_complex z;
14361 z.real = x;
14362 z.imag = y;
14363 return z;
14364 }
14365#endif
14366
14367/* Arithmetic */
14368#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
14369#else
14370 static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
14371 return (a.real == b.real) && (a.imag == b.imag);
14372 }
14373 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
14374 __pyx_t_double_complex z;
14375 z.real = a.real + b.real;
14376 z.imag = a.imag + b.imag;
14377 return z;
14378 }
14379 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
14380 __pyx_t_double_complex z;
14381 z.real = a.real - b.real;
14382 z.imag = a.imag - b.imag;
14383 return z;
14384 }
14385 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
14386 __pyx_t_double_complex z;
14387 z.real = a.real * b.real - a.imag * b.imag;
14388 z.imag = a.real * b.imag + a.imag * b.real;
14389 return z;
14390 }
14391 #if 1
14392 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
14393 if (b.imag == 0) {
14394 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
14395 } else if (fabs(b.real) >= fabs(b.imag)) {
14396 if (b.real == 0 && b.imag == 0) {
14397 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
14398 } else {
14399 double r = b.imag / b.real;
14400 double s = (double)(1.0) / (b.real + b.imag * r);
14401 return __pyx_t_double_complex_from_parts(
14402 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
14403 }
14404 } else {
14405 double r = b.real / b.imag;
14406 double s = (double)(1.0) / (b.imag + b.real * r);
14407 return __pyx_t_double_complex_from_parts(
14408 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
14409 }
14410 }
14411 #else
14412 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
14413 if (b.imag == 0) {
14414 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
14415 } else {
14416 double denom = b.real * b.real + b.imag * b.imag;
14417 return __pyx_t_double_complex_from_parts(
14418 (a.real * b.real + a.imag * b.imag) / denom,
14419 (a.imag * b.real - a.real * b.imag) / denom);
14420 }
14421 }
14422 #endif
14423 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
14424 __pyx_t_double_complex z;
14425 z.real = -a.real;
14426 z.imag = -a.imag;
14427 return z;
14428 }
14429 static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
14430 return (a.real == 0) && (a.imag == 0);
14431 }
14432 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
14433 __pyx_t_double_complex z;
14434 z.real = a.real;
14435 z.imag = -a.imag;
14436 return z;
14437 }
14438 #if 1
14439 static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
14440 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
14441 return sqrt(z.real*z.real + z.imag*z.imag);
14442 #else
14443 return hypot(z.real, z.imag);
14444 #endif
14445 }
14446 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
14447 __pyx_t_double_complex z;
14448 double r, lnr, theta, z_r, z_theta;
14449 if (b.imag == 0 && b.real == (int)b.real) {
14450 if (b.real < 0) {
14451 double denom = a.real * a.real + a.imag * a.imag;
14452 a.real = a.real / denom;
14453 a.imag = -a.imag / denom;
14454 b.real = -b.real;
14455 }
14456 switch ((int)b.real) {
14457 case 0:
14458 z.real = 1;
14459 z.imag = 0;
14460 return z;
14461 case 1:
14462 return a;
14463 case 2:
14464 return __Pyx_c_prod_double(a, a);
14465 case 3:
14466 z = __Pyx_c_prod_double(a, a);
14467 return __Pyx_c_prod_double(z, a);
14468 case 4:
14469 z = __Pyx_c_prod_double(a, a);
14470 return __Pyx_c_prod_double(z, z);
14471 }
14472 }
14473 if (a.imag == 0) {
14474 if (a.real == 0) {
14475 return a;
14476 } else if ((b.imag == 0) && (a.real >= 0)) {
14477 z.real = pow(a.real, b.real);
14478 z.imag = 0;
14479 return z;
14480 } else if (a.real > 0) {
14481 r = a.real;
14482 theta = 0;
14483 } else {
14484 r = -a.real;
14485 theta = atan2(0.0, -1.0);
14486 }
14487 } else {
14488 r = __Pyx_c_abs_double(a);
14489 theta = atan2(a.imag, a.real);
14490 }
14491 lnr = log(r);
14492 z_r = exp(lnr * b.real - theta * b.imag);
14493 z_theta = theta * b.real + lnr * b.imag;
14494 z.real = z_r * cos(z_theta);
14495 z.imag = z_r * sin(z_theta);
14496 return z;
14497 }
14498 #endif
14499#endif
14500
14501/* Declarations */
14502#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
14503 #ifdef __cplusplus
14504 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
14505 return ::std::complex< long double >(x, y);
14506 }
14507 #else
14508 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
14509 return x + y*(__pyx_t_long_double_complex)_Complex_I;
14510 }
14511 #endif
14512#else
14513 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
14514 __pyx_t_long_double_complex z;
14515 z.real = x;
14516 z.imag = y;
14517 return z;
14518 }
14519#endif
14520
14521/* Arithmetic */
14522#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
14523#else
14524 static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
14525 return (a.real == b.real) && (a.imag == b.imag);
14526 }
14527 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
14528 __pyx_t_long_double_complex z;
14529 z.real = a.real + b.real;
14530 z.imag = a.imag + b.imag;
14531 return z;
14532 }
14533 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
14534 __pyx_t_long_double_complex z;
14535 z.real = a.real - b.real;
14536 z.imag = a.imag - b.imag;
14537 return z;
14538 }
14539 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
14540 __pyx_t_long_double_complex z;
14541 z.real = a.real * b.real - a.imag * b.imag;
14542 z.imag = a.real * b.imag + a.imag * b.real;
14543 return z;
14544 }
14545 #if 1
14546 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
14547 if (b.imag == 0) {
14548 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
14549 } else if (fabsl(b.real) >= fabsl(b.imag)) {
14550 if (b.real == 0 && b.imag == 0) {
14551 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
14552 } else {
14553 long double r = b.imag / b.real;
14554 long double s = (long double)(1.0) / (b.real + b.imag * r);
14555 return __pyx_t_long_double_complex_from_parts(
14556 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
14557 }
14558 } else {
14559 long double r = b.real / b.imag;
14560 long double s = (long double)(1.0) / (b.imag + b.real * r);
14561 return __pyx_t_long_double_complex_from_parts(
14562 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
14563 }
14564 }
14565 #else
14566 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
14567 if (b.imag == 0) {
14568 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
14569 } else {
14570 long double denom = b.real * b.real + b.imag * b.imag;
14571 return __pyx_t_long_double_complex_from_parts(
14572 (a.real * b.real + a.imag * b.imag) / denom,
14573 (a.imag * b.real - a.real * b.imag) / denom);
14574 }
14575 }
14576 #endif
14577 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex a) {
14578 __pyx_t_long_double_complex z;
14579 z.real = -a.real;
14580 z.imag = -a.imag;
14581 return z;
14582 }
14583 static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex a) {
14584 return (a.real == 0) && (a.imag == 0);
14585 }
14586 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex a) {
14587 __pyx_t_long_double_complex z;
14588 z.real = a.real;
14589 z.imag = -a.imag;
14590 return z;
14591 }
14592 #if 1
14593 static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex z) {
14594 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
14595 return sqrtl(z.real*z.real + z.imag*z.imag);
14596 #else
14597 return hypotl(z.real, z.imag);
14598 #endif
14599 }
14600 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
14601 __pyx_t_long_double_complex z;
14602 long double r, lnr, theta, z_r, z_theta;
14603 if (b.imag == 0 && b.real == (int)b.real) {
14604 if (b.real < 0) {
14605 long double denom = a.real * a.real + a.imag * a.imag;
14606 a.real = a.real / denom;
14607 a.imag = -a.imag / denom;
14608 b.real = -b.real;
14609 }
14610 switch ((int)b.real) {
14611 case 0:
14612 z.real = 1;
14613 z.imag = 0;
14614 return z;
14615 case 1:
14616 return a;
14617 case 2:
14618 return __Pyx_c_prod_long__double(a, a);
14619 case 3:
14620 z = __Pyx_c_prod_long__double(a, a);
14621 return __Pyx_c_prod_long__double(z, a);
14622 case 4:
14623 z = __Pyx_c_prod_long__double(a, a);
14624 return __Pyx_c_prod_long__double(z, z);
14625 }
14626 }
14627 if (a.imag == 0) {
14628 if (a.real == 0) {
14629 return a;
14630 } else if ((b.imag == 0) && (a.real >= 0)) {
14631 z.real = powl(a.real, b.real);
14632 z.imag = 0;
14633 return z;
14634 } else if (a.real > 0) {
14635 r = a.real;
14636 theta = 0;
14637 } else {
14638 r = -a.real;
14639 theta = atan2l(0.0, -1.0);
14640 }
14641 } else {
14642 r = __Pyx_c_abs_long__double(a);
14643 theta = atan2l(a.imag, a.real);
14644 }
14645 lnr = logl(r);
14646 z_r = expl(lnr * b.real - theta * b.imag);
14647 z_theta = theta * b.real + lnr * b.imag;
14648 z.real = z_r * cosl(z_theta);
14649 z.imag = z_r * sinl(z_theta);
14650 return z;
14651 }
14652 #endif
14653#endif
14654
14655/* CIntToPy */
14656static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) {
14657#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
14658#pragma GCC diagnostic push
14659#pragma GCC diagnostic ignored "-Wconversion"
14660#endif
14661 const long neg_one = (long) -1, const_zero = (long) 0;
14662#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
14663#pragma GCC diagnostic pop
14664#endif
14665 const int is_unsigned = neg_one > const_zero;
14666 if (is_unsigned) {
14667 if (sizeof(long) < sizeof(long)) {
14668 return PyLong_FromLong((long) value);
14669 } else if (sizeof(long) <= sizeof(unsigned long)) {
14670 return PyLong_FromUnsignedLong((unsigned long) value);
14671#if !CYTHON_COMPILING_IN_PYPY
14672 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
14673 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
14674#endif
14675 }
14676 } else {
14677 if (sizeof(long) <= sizeof(long)) {
14678 return PyLong_FromLong((long) value);
14679 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
14680 return PyLong_FromLongLong((PY_LONG_LONG) value);
14681 }
14682 }
14683 {
14684 unsigned char *bytes = (unsigned char *)&value;
14685#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
14686 if (is_unsigned) {
14687 return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
14688 } else {
14689 return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
14690 }
14691#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
14692 int one = 1; int little = (int)*(unsigned char *)&one;
14693 return _PyLong_FromByteArray(bytes, sizeof(long),
14694 little, !is_unsigned);
14695#else
14696 int one = 1; int little = (int)*(unsigned char *)&one;
14697 PyObject *result = NULL, *kwds = NULL;
14698 PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
14699 py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
14700 if (!py_bytes) goto limited_bad;
14701 from_bytes_str = PyUnicode_FromStringAndSize("from_bytes", 10);
14702 if (!from_bytes_str) goto limited_bad;
14703 order_str = PyUnicode_FromString(little ? "little" : "big");
14704 if (!order_str) goto limited_bad;
14705 {
14706 PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
14707 if (!is_unsigned) {
14708 PyObject *signed_str = PyUnicode_FromStringAndSize("signed", 6);
14709 if (!signed_str) goto limited_bad;
14710#if CYTHON_VECTORCALL
14711 kwds = PyTuple_Pack(1, signed_str);
14712#else
14713 {
14714 PyObject *keys[] = {signed_str};
14715 PyObject *values[] = {Py_True};
14716 kwds = __Pyx_MakeKwargDict(keys, values, 1);
14717 }
14718#endif
14719 Py_DECREF(signed_str);
14720 if (unlikely(!kwds)) goto limited_bad;
14721 }
14722 result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
14723 }
14724 limited_bad:
14725 Py_XDECREF(kwds);
14726 Py_XDECREF(order_str);
14727 Py_XDECREF(py_bytes);
14728 Py_XDECREF(from_bytes_str);
14729 return result;
14730#endif
14731 }
14732}
14733
14734/* CIntFromPyVerify (used by CIntFromPy) */
14735#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
14736 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
14737#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
14738 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
14739#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
14740 {\
14741 func_type value = func_value;\
14742 if (sizeof(target_type) < sizeof(func_type)) {\
14743 if (unlikely(value != (func_type) (target_type) value)) {\
14744 func_type zero = 0;\
14745 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
14746 return (target_type) -1;\
14747 if (is_unsigned && unlikely(value < zero))\
14748 goto raise_neg_overflow;\
14749 else\
14750 goto raise_overflow;\
14751 }\
14752 }\
14753 return (target_type) value;\
14754 }
14755
14756/* CIntFromPy */
14757static long __Pyx_LargePyLong___Pyx_PyLong_As_long(PyObject *x);
14758static long __Pyx_raise_neg_overflow___Pyx_PyLong_As_long(void) {
14759 const char* type_name = "long";
14760 PyErr_Format(PyExc_OverflowError,
14761 "can't convert negative value to %.200s", type_name);
14762 return (long) -1;
14763}
14764static long __Pyx_raise_overflow___Pyx_PyLong_As_long(void) {
14765 const char* type_name = "long";
14766 PyErr_Format(PyExc_OverflowError,
14767 "value too large to convert to %.200s", type_name);
14768 return (long) -1;
14769}
14770static CYTHON_INLINE long __Pyx_PyULong___Pyx_PyLong_As_long(PyObject *x) {
14771 const int is_unsigned = 1;
14772#if CYTHON_USE_PYLONG_INTERNALS
14773 {
14774 const digit* digits = __Pyx_PyLong_Digits(x);
14775 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
14776 if (size == 2 && (8 * sizeof(long) > 1 * PyLong_SHIFT)) {
14777 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
14778 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
14779 } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) {
14780 return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
14781 }
14782 } else
14783 if (size == 3 && (8 * sizeof(long) > 2 * PyLong_SHIFT)) {
14784 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
14785 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
14786 } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) {
14787 return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
14788 }
14789 } else
14790 if (size == 4 && (8 * sizeof(long) > 3 * PyLong_SHIFT)) {
14791 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
14792 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
14793 } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) {
14794 return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
14795 }
14796 } else
14797 {}
14798 }
14799#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
14800 if (unlikely(Py_SIZE(x) < 0)) {
14801 goto raise_neg_overflow;
14802 }
14803#else
14804 {
14805 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
14806 if (unlikely(result < 0))
14807 return (long) -1;
14808 if (unlikely(result == 1))
14809 goto raise_neg_overflow;
14810 }
14811#endif
14812 if ((sizeof(long) <= sizeof(unsigned long))) {
14813 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
14814 } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
14815 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
14816 }
14817 return __Pyx_LargePyLong___Pyx_PyLong_As_long(x);
14818raise_neg_overflow:
14819 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
14820raise_overflow:
14821 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
14822}
14823static CYTHON_INLINE long __Pyx_PySLong___Pyx_PyLong_As_long(PyObject *x) {
14824 const int is_unsigned = 0;
14825#if CYTHON_USE_PYLONG_INTERNALS
14826 if (__Pyx_PyLong_IsNeg(x)) {
14827 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
14828 const digit* digits = __Pyx_PyLong_Digits(x);
14829 if (size == 2 && (8 * sizeof(long) > 1 * PyLong_SHIFT)) {
14830 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
14831 long ival = - (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
14832 __PYX_VERIFY_RETURN_INT(long, long, ival)
14833 } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
14834 return (long) (((long) -1) * (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
14835 }
14836 } else
14837 if (size == 3 && (8 * sizeof(long) > 2 * PyLong_SHIFT)) {
14838 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
14839 long ival = - (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
14840 __PYX_VERIFY_RETURN_INT(long, long, ival)
14841 } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
14842 return (long) (((long) -1) * (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
14843 }
14844 } else
14845 if (size == 4 && (8 * sizeof(long) > 3 * PyLong_SHIFT)) {
14846 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
14847 long ival = - (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
14848 __PYX_VERIFY_RETURN_INT(long, long, ival)
14849 } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
14850 return (long) (((long) -1) * (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
14851 }
14852 } else
14853 {}
14854 } else {
14855 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
14856 const digit* digits = __Pyx_PyLong_Digits(x);
14857 if (size == 2 && (8 * sizeof(long) > 1 * PyLong_SHIFT)) {
14858 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
14859 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
14860 } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
14861 return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
14862 }
14863 } else
14864 if (size == 3 && (8 * sizeof(long) > 2 * PyLong_SHIFT)) {
14865 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
14866 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
14867 } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
14868 return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
14869 }
14870 } else
14871 if (size == 4 && (8 * sizeof(long) > 3 * PyLong_SHIFT)) {
14872 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
14873 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
14874 } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
14875 return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
14876 }
14877 } else
14878 {}
14879 }
14880#endif
14881 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
14882 if ((sizeof(long) <= sizeof(int)) && (sizeof(int) < sizeof(long))) {
14883 __PYX_VERIFY_RETURN_INT_EXC(long, int, PyLong_AsInt(x))
14884 } else
14885 #endif
14886 if ((sizeof(long) <= sizeof(long))) {
14887 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
14888 } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
14889 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
14890 }
14891 return __Pyx_LargePyLong___Pyx_PyLong_As_long(x);
14892raise_neg_overflow:
14893 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
14894raise_overflow:
14895 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
14896}
14897static long __Pyx_LargePyLong___Pyx_PyLong_As_long(PyObject *x) {
14898#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
14899#pragma GCC diagnostic push
14900#pragma GCC diagnostic ignored "-Wconversion"
14901#endif
14902 const long neg_one = (long) -1, const_zero = (long) 0;
14903#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
14904#pragma GCC diagnostic pop
14905#endif
14906 const int is_unsigned = neg_one > const_zero;
14907 long val;
14908 int ret = -1;
14909#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
14910 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
14911 x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
14912 if (unlikely(bytes_copied == -1)) {
14913 } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
14914 goto raise_overflow;
14915 } else {
14916 ret = 0;
14917 }
14918#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
14919 int one = 1; int is_little = (int)*(unsigned char *)&one;
14920 unsigned char *bytes = (unsigned char *)&val;
14921 ret = _PyLong_AsByteArray((PyLongObject *)x,
14922 bytes, sizeof(val),
14923 is_little, !is_unsigned);
14924 if ((0)) goto raise_overflow;
14925#else
14926 PyObject *v;
14927 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
14928 int bits, remaining_bits, is_negative = 0;
14929 int chunk_size = (sizeof(long) < 8) ? 30 : 62;
14930 if (likely(PyLong_CheckExact(x))) {
14931 v = __Pyx_NewRef(x);
14932 } else {
14933 v = PyNumber_Long(x);
14934 if (unlikely(!v)) return (long) -1;
14935 assert(PyLong_CheckExact(v));
14936 }
14937 {
14938 int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
14939 if (unlikely(result < 0)) {
14940 Py_DECREF(v);
14941 return (long) -1;
14942 }
14943 is_negative = result == 1;
14944 }
14945 if (is_unsigned && unlikely(is_negative)) {
14946 Py_DECREF(v);
14947 PyErr_SetString(PyExc_OverflowError,
14948 "can't convert negative value to long");
14949 return (long) -1;
14950 } else if (is_negative) {
14951 stepval = PyNumber_Invert(v);
14952 Py_DECREF(v);
14953 if (unlikely(!stepval))
14954 return (long) -1;
14955 } else {
14956 stepval = v;
14957 }
14958 v = NULL;
14959 val = (long) 0;
14960 mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
14961 shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
14962 for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
14963 PyObject *tmp, *digit;
14964 long idigit;
14965 digit = PyNumber_And(stepval, mask);
14966 if (unlikely(!digit)) goto done;
14967 idigit = PyLong_AsLong(digit);
14968 Py_DECREF(digit);
14969 if (unlikely(idigit < 0)) goto done;
14970 val |= ((long) idigit) << bits;
14971 tmp = PyNumber_Rshift(stepval, shift);
14972 if (unlikely(!tmp)) goto done;
14973 Py_DECREF(stepval); stepval = tmp;
14974 }
14975 Py_DECREF(shift); shift = NULL;
14976 Py_DECREF(mask); mask = NULL;
14977 {
14978 long idigit = PyLong_AsLong(stepval);
14979 if (unlikely(idigit < 0)) goto done;
14980 remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
14981 if (unlikely(idigit >= (1L << remaining_bits)))
14982 goto raise_overflow;
14983 val |= ((long) idigit) << bits;
14984 }
14985 if (!is_unsigned) {
14986 if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
14987 goto raise_overflow;
14988 if (is_negative)
14989 val = ~val;
14990 }
14991 ret = 0;
14992done:
14993 Py_XDECREF(shift);
14994 Py_XDECREF(mask);
14995 Py_XDECREF(stepval);
14996#endif
14997 if (unlikely(ret))
14998 return (long) -1;
14999 return val;
15000raise_overflow:
15001 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
15002}
15003static CYTHON_INLINE long __Pyx_PyLong___Pyx_PyLong_As_long(PyObject *x) {
15004#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
15005#pragma GCC diagnostic push
15006#pragma GCC diagnostic ignored "-Wconversion"
15007#endif
15008 const long neg_one = (long) -1, const_zero = (long) 0;
15009#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
15010#pragma GCC diagnostic pop
15011#endif
15012 const int is_unsigned = neg_one > const_zero;
15013 if (is_unsigned) {
15014 #if CYTHON_USE_PYLONG_INTERNALS
15015 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
15016 goto raise_neg_overflow;
15017 } else if (__Pyx_PyLong_IsCompact(x)) {
15018 __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
15019 } else
15020 #endif
15021 {
15022 return __Pyx_PyULong___Pyx_PyLong_As_long(x);
15023 }
15024 } else {
15025 #if CYTHON_USE_PYLONG_INTERNALS
15026 if (__Pyx_PyLong_IsCompact(x)) {
15027 __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
15028 } else
15029 #endif
15030 {
15031 return __Pyx_PySLong___Pyx_PyLong_As_long(x);
15032 }
15033 }
15034#if CYTHON_USE_PYLONG_INTERNALS
15035raise_neg_overflow:
15036 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
15037raise_overflow:
15038 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
15039#endif
15040}
15041static long __Pyx_NonPyLong___Pyx_PyLong_As_long(PyObject *x) {
15042 long val;
15043 PyObject *tmp = __Pyx_PyNumber_Long(x);
15044 if (!tmp) return (long) -1;
15045 val = __Pyx_PyLong_As_long(tmp);
15046 Py_DECREF(tmp);
15047 return val;
15048}
15049static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) {
15050 if (likely(PyLong_Check(x))) {
15051 return __Pyx_PyLong___Pyx_PyLong_As_long(x);
15052 } else {
15053 return __Pyx_NonPyLong___Pyx_PyLong_As_long(x);
15054 }
15055}
15056
15057/* CIntFromPy */
15058static int __Pyx_LargePyLong___Pyx_PyLong_As_int(PyObject *x);
15059static int __Pyx_raise_neg_overflow___Pyx_PyLong_As_int(void) {
15060 const char* type_name = "int";
15061 PyErr_Format(PyExc_OverflowError,
15062 "can't convert negative value to %.200s", type_name);
15063 return (int) -1;
15064}
15065static int __Pyx_raise_overflow___Pyx_PyLong_As_int(void) {
15066 const char* type_name = "int";
15067 PyErr_Format(PyExc_OverflowError,
15068 "value too large to convert to %.200s", type_name);
15069 return (int) -1;
15070}
15071static CYTHON_INLINE int __Pyx_PyULong___Pyx_PyLong_As_int(PyObject *x) {
15072 const int is_unsigned = 1;
15073#if CYTHON_USE_PYLONG_INTERNALS
15074 {
15075 const digit* digits = __Pyx_PyLong_Digits(x);
15076 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
15077 if (size == 2 && (8 * sizeof(int) > 1 * PyLong_SHIFT)) {
15078 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
15079 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
15080 } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) {
15081 return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
15082 }
15083 } else
15084 if (size == 3 && (8 * sizeof(int) > 2 * PyLong_SHIFT)) {
15085 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
15086 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
15087 } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) {
15088 return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
15089 }
15090 } else
15091 if (size == 4 && (8 * sizeof(int) > 3 * PyLong_SHIFT)) {
15092 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
15093 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
15094 } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) {
15095 return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
15096 }
15097 } else
15098 {}
15099 }
15100#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
15101 if (unlikely(Py_SIZE(x) < 0)) {
15102 goto raise_neg_overflow;
15103 }
15104#else
15105 {
15106 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
15107 if (unlikely(result < 0))
15108 return (int) -1;
15109 if (unlikely(result == 1))
15110 goto raise_neg_overflow;
15111 }
15112#endif
15113 if ((sizeof(int) <= sizeof(unsigned long))) {
15114 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
15115 } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
15116 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
15117 }
15118 return __Pyx_LargePyLong___Pyx_PyLong_As_int(x);
15119raise_neg_overflow:
15120 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
15121raise_overflow:
15122 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
15123}
15124static CYTHON_INLINE int __Pyx_PySLong___Pyx_PyLong_As_int(PyObject *x) {
15125 const int is_unsigned = 0;
15126#if CYTHON_USE_PYLONG_INTERNALS
15127 if (__Pyx_PyLong_IsNeg(x)) {
15128 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
15129 const digit* digits = __Pyx_PyLong_Digits(x);
15130 if (size == 2 && (8 * sizeof(int) > 1 * PyLong_SHIFT)) {
15131 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
15132 long ival = - (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
15133 __PYX_VERIFY_RETURN_INT(int, long, ival)
15134 } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
15135 return (int) (((int) -1) * (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
15136 }
15137 } else
15138 if (size == 3 && (8 * sizeof(int) > 2 * PyLong_SHIFT)) {
15139 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
15140 long ival = - (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
15141 __PYX_VERIFY_RETURN_INT(int, long, ival)
15142 } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
15143 return (int) (((int) -1) * (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
15144 }
15145 } else
15146 if (size == 4 && (8 * sizeof(int) > 3 * PyLong_SHIFT)) {
15147 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
15148 long ival = - (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
15149 __PYX_VERIFY_RETURN_INT(int, long, ival)
15150 } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
15151 return (int) (((int) -1) * (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
15152 }
15153 } else
15154 {}
15155 } else {
15156 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
15157 const digit* digits = __Pyx_PyLong_Digits(x);
15158 if (size == 2 && (8 * sizeof(int) > 1 * PyLong_SHIFT)) {
15159 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
15160 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
15161 } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
15162 return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
15163 }
15164 } else
15165 if (size == 3 && (8 * sizeof(int) > 2 * PyLong_SHIFT)) {
15166 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
15167 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
15168 } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
15169 return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
15170 }
15171 } else
15172 if (size == 4 && (8 * sizeof(int) > 3 * PyLong_SHIFT)) {
15173 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
15174 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
15175 } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
15176 return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
15177 }
15178 } else
15179 {}
15180 }
15181#endif
15182 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
15183 if ((sizeof(int) <= sizeof(int)) && (sizeof(int) < sizeof(long))) {
15184 __PYX_VERIFY_RETURN_INT_EXC(int, int, PyLong_AsInt(x))
15185 } else
15186 #endif
15187 if ((sizeof(int) <= sizeof(long))) {
15188 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
15189 } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
15190 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
15191 }
15192 return __Pyx_LargePyLong___Pyx_PyLong_As_int(x);
15193raise_neg_overflow:
15194 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
15195raise_overflow:
15196 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
15197}
15198static int __Pyx_LargePyLong___Pyx_PyLong_As_int(PyObject *x) {
15199#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
15200#pragma GCC diagnostic push
15201#pragma GCC diagnostic ignored "-Wconversion"
15202#endif
15203 const int neg_one = (int) -1, const_zero = (int) 0;
15204#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
15205#pragma GCC diagnostic pop
15206#endif
15207 const int is_unsigned = neg_one > const_zero;
15208 int val;
15209 int ret = -1;
15210#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
15211 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
15212 x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
15213 if (unlikely(bytes_copied == -1)) {
15214 } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
15215 goto raise_overflow;
15216 } else {
15217 ret = 0;
15218 }
15219#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
15220 int one = 1; int is_little = (int)*(unsigned char *)&one;
15221 unsigned char *bytes = (unsigned char *)&val;
15222 ret = _PyLong_AsByteArray((PyLongObject *)x,
15223 bytes, sizeof(val),
15224 is_little, !is_unsigned);
15225 if ((0)) goto raise_overflow;
15226#else
15227 PyObject *v;
15228 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
15229 int bits, remaining_bits, is_negative = 0;
15230 int chunk_size = (sizeof(long) < 8) ? 30 : 62;
15231 if (likely(PyLong_CheckExact(x))) {
15232 v = __Pyx_NewRef(x);
15233 } else {
15234 v = PyNumber_Long(x);
15235 if (unlikely(!v)) return (int) -1;
15236 assert(PyLong_CheckExact(v));
15237 }
15238 {
15239 int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
15240 if (unlikely(result < 0)) {
15241 Py_DECREF(v);
15242 return (int) -1;
15243 }
15244 is_negative = result == 1;
15245 }
15246 if (is_unsigned && unlikely(is_negative)) {
15247 Py_DECREF(v);
15248 PyErr_SetString(PyExc_OverflowError,
15249 "can't convert negative value to int");
15250 return (int) -1;
15251 } else if (is_negative) {
15252 stepval = PyNumber_Invert(v);
15253 Py_DECREF(v);
15254 if (unlikely(!stepval))
15255 return (int) -1;
15256 } else {
15257 stepval = v;
15258 }
15259 v = NULL;
15260 val = (int) 0;
15261 mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
15262 shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
15263 for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
15264 PyObject *tmp, *digit;
15265 long idigit;
15266 digit = PyNumber_And(stepval, mask);
15267 if (unlikely(!digit)) goto done;
15268 idigit = PyLong_AsLong(digit);
15269 Py_DECREF(digit);
15270 if (unlikely(idigit < 0)) goto done;
15271 val |= ((int) idigit) << bits;
15272 tmp = PyNumber_Rshift(stepval, shift);
15273 if (unlikely(!tmp)) goto done;
15274 Py_DECREF(stepval); stepval = tmp;
15275 }
15276 Py_DECREF(shift); shift = NULL;
15277 Py_DECREF(mask); mask = NULL;
15278 {
15279 long idigit = PyLong_AsLong(stepval);
15280 if (unlikely(idigit < 0)) goto done;
15281 remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
15282 if (unlikely(idigit >= (1L << remaining_bits)))
15283 goto raise_overflow;
15284 val |= ((int) idigit) << bits;
15285 }
15286 if (!is_unsigned) {
15287 if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
15288 goto raise_overflow;
15289 if (is_negative)
15290 val = ~val;
15291 }
15292 ret = 0;
15293done:
15294 Py_XDECREF(shift);
15295 Py_XDECREF(mask);
15296 Py_XDECREF(stepval);
15297#endif
15298 if (unlikely(ret))
15299 return (int) -1;
15300 return val;
15301raise_overflow:
15302 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
15303}
15304static CYTHON_INLINE int __Pyx_PyLong___Pyx_PyLong_As_int(PyObject *x) {
15305#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
15306#pragma GCC diagnostic push
15307#pragma GCC diagnostic ignored "-Wconversion"
15308#endif
15309 const int neg_one = (int) -1, const_zero = (int) 0;
15310#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
15311#pragma GCC diagnostic pop
15312#endif
15313 const int is_unsigned = neg_one > const_zero;
15314 if (is_unsigned) {
15315 #if CYTHON_USE_PYLONG_INTERNALS
15316 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
15317 goto raise_neg_overflow;
15318 } else if (__Pyx_PyLong_IsCompact(x)) {
15319 __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
15320 } else
15321 #endif
15322 {
15323 return __Pyx_PyULong___Pyx_PyLong_As_int(x);
15324 }
15325 } else {
15326 #if CYTHON_USE_PYLONG_INTERNALS
15327 if (__Pyx_PyLong_IsCompact(x)) {
15328 __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
15329 } else
15330 #endif
15331 {
15332 return __Pyx_PySLong___Pyx_PyLong_As_int(x);
15333 }
15334 }
15335#if CYTHON_USE_PYLONG_INTERNALS
15336raise_neg_overflow:
15337 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
15338raise_overflow:
15339 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
15340#endif
15341}
15342static int __Pyx_NonPyLong___Pyx_PyLong_As_int(PyObject *x) {
15343 int val;
15344 PyObject *tmp = __Pyx_PyNumber_Long(x);
15345 if (!tmp) return (int) -1;
15346 val = __Pyx_PyLong_As_int(tmp);
15347 Py_DECREF(tmp);
15348 return val;
15349}
15350static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) {
15351 if (likely(PyLong_Check(x))) {
15352 return __Pyx_PyLong___Pyx_PyLong_As_int(x);
15353 } else {
15354 return __Pyx_NonPyLong___Pyx_PyLong_As_int(x);
15355 }
15356}
15357
15358/* GetRuntimeVersion */
15359#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
15360void __Pyx_init_runtime_version(void) {
15361 if (__Pyx_cached_runtime_version == 0) {
15362 const char* rt_version = Py_GetVersion();
15363 unsigned long version = 0;
15364 unsigned long factor = 0x01000000UL;
15365 unsigned int digit = 0;
15366 int i = 0;
15367 while (factor) {
15368 while ('0' <= rt_version[i] && rt_version[i] <= '9') {
15369 digit = digit * 10 + (unsigned int) (rt_version[i] - '0');
15370 ++i;
15371 }
15372 version += factor * digit;
15373 if (rt_version[i] != '.')
15374 break;
15375 digit = 0;
15376 factor >>= 8;
15377 ++i;
15378 }
15379 __Pyx_cached_runtime_version = version;
15380 }
15381}
15382#endif
15383static unsigned long __Pyx_get_runtime_version(void) {
15384#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
15385 return Py_Version & ~0xFFUL;
15386#else
15387 return __Pyx_cached_runtime_version;
15388#endif
15389}
15390
15391/* CheckBinaryVersion */
15392static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) {
15393 const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
15394 if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
15395 return 0;
15396 if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
15397 return 1;
15398 {
15399 char message[200];
15400 PyOS_snprintf(message, sizeof(message),
15401 "compile time Python version %d.%d "
15402 "of module '%.100s' "
15403 "%s "
15404 "runtime version %d.%d",
15405 (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF),
15406 __Pyx_MODULE_NAME,
15407 (allow_newer) ? "was newer than" : "does not match",
15408 (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
15409 );
15410 return PyErr_WarnEx(NULL, message, 1);
15411 }
15412}
15413
15414/* NewCodeObj */
15415#if CYTHON_COMPILING_IN_LIMITED_API
15416 static PyObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f,
15417 PyObject *code, PyObject *c, PyObject* n, PyObject *v,
15418 PyObject *fv, PyObject *cell, PyObject* fn,
15419 PyObject *name, int fline, PyObject *lnos) {
15420 PyObject *exception_table = NULL;
15421 PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
15422 #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
15423 PyObject *version_info;
15424 PyObject *py_minor_version = NULL;
15425 #endif
15426 long minor_version = 0;
15427 #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
15428 minor_version = 11;
15429 #else
15430 if (!(version_info = PySys_GetObject("version_info"))) goto end;
15431 if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
15432 minor_version = PyLong_AsLong(py_minor_version);
15433 Py_DECREF(py_minor_version);
15434 if (minor_version == -1 && PyErr_Occurred()) goto end;
15435 #endif
15436 if (!(types_module = PyImport_ImportModule("types"))) goto end;
15437 if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end;
15438 if (minor_version <= 10) {
15439 result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOOO", a,p, k, l, s, f, code,
15440 c, n, v, fn, name, fline, lnos, fv, cell);
15441 } else {
15442 if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end;
15443 result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOOOO", a,p, k, l, s, f, code,
15444 c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell);
15445 }
15446 end:
15447 Py_XDECREF(code_type);
15448 Py_XDECREF(exception_table);
15449 Py_XDECREF(types_module);
15450 if (!result) {
15451 PyObject *exc_type, *exc_value, *exc_tb;
15452 PyErr_Fetch(&exc_type, &exc_value, &exc_tb);
15453 if (PyErr_WarnFormat(
15454 PyExc_RuntimeWarning, 1,
15455 "Code object creation failed in Cython module: %S\nTry recompiling with a more recent version of Cython.",
15456 exc_value ? exc_value : exc_type) == 0) {
15457 result = Py_None;
15458 Py_INCREF(result);
15459 }
15460 Py_DECREF(exc_type);
15461 Py_XDECREF(exc_value);
15462 Py_XDECREF(exc_tb);
15463 }
15464 return result;
15465 }
15466#elif PY_VERSION_HEX >= 0x030B0000
15467 static PyCodeObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f,
15468 PyObject *code, PyObject *c, PyObject* n, PyObject *v,
15469 PyObject *fv, PyObject *cell, PyObject* fn,
15470 PyObject *name, int fline, PyObject *lnos) {
15471 PyCodeObject *result;
15472 result =
15473 #if PY_VERSION_HEX >= 0x030C0000
15474 PyUnstable_Code_NewWithPosOnlyArgs
15475 #else
15476 PyCode_NewWithPosOnlyArgs
15477 #endif
15478 (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes);
15479 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030c00A1
15480 if (likely(result))
15481 result->_co_firsttraceable = 0;
15482 #endif
15483 return result;
15484 }
15485#elif !CYTHON_COMPILING_IN_PYPY
15486 #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
15487 PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
15488#else
15489 #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
15490 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
15491#endif
15492static PyObject* __Pyx_PyCode_New(
15493 const __Pyx_PyCode_New_function_description descr,
15494 PyObject * const *varnames,
15495 PyObject *filename,
15496 PyObject *funcname,
15497 PyObject *line_table,
15498 PyObject *tuple_dedup_map
15499) {
15500 PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL;
15501 Py_ssize_t var_count = (Py_ssize_t) descr.nlocals;
15502 PyObject *varnames_tuple = PyTuple_New(var_count);
15503 if (unlikely(!varnames_tuple)) return NULL;
15504 for (Py_ssize_t i=0; i < var_count; i++) {
15505 Py_INCREF(varnames[i]);
15506 if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0)) goto done;
15507 }
15508 #if CYTHON_COMPILING_IN_LIMITED_API
15509 varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple);
15510 if (!varnames_tuple_dedup) {
15511 if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0)) goto done;
15512 varnames_tuple_dedup = varnames_tuple;
15513 }
15514 #else
15515 varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple);
15516 if (unlikely(!varnames_tuple_dedup)) goto done;
15517 #endif
15518 #if CYTHON_AVOID_BORROWED_REFS
15519 Py_INCREF(varnames_tuple_dedup);
15520 #endif
15521 if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL && !CYTHON_COMPILING_IN_GRAAL) {
15522 Py_ssize_t line_table_length = __Pyx_PyBytes_GET_SIZE(line_table);
15523 #if !CYTHON_ASSUME_SAFE_SIZE
15524 if (unlikely(line_table_length == -1)) goto done;
15525 #endif
15526 Py_ssize_t code_len = (line_table_length * 2 + 4) & ~3LL;
15527 code_bytes = PyBytes_FromStringAndSize(NULL, code_len);
15528 if (unlikely(!code_bytes)) goto done;
15529 char* c_code_bytes = PyBytes_AsString(code_bytes);
15530 if (unlikely(!c_code_bytes)) goto done;
15531 memset(c_code_bytes, 0, (size_t) code_len);
15532 }
15533 code_obj = (PyObject*) __Pyx__PyCode_New(
15534 (int) descr.argcount,
15535 (int) descr.num_posonly_args,
15536 (int) descr.num_kwonly_args,
15537 (int) descr.nlocals,
15538 0,
15539 (int) descr.flags,
15540 code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes,
15541 __pyx_mstate_global->__pyx_empty_tuple,
15542 __pyx_mstate_global->__pyx_empty_tuple,
15543 varnames_tuple_dedup,
15544 __pyx_mstate_global->__pyx_empty_tuple,
15545 __pyx_mstate_global->__pyx_empty_tuple,
15546 filename,
15547 funcname,
15548 (int) descr.first_line,
15549 (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table) ? line_table : __pyx_mstate_global->__pyx_empty_bytes
15550 );
15551done:
15552 Py_XDECREF(code_bytes);
15553 #if CYTHON_AVOID_BORROWED_REFS
15554 Py_XDECREF(varnames_tuple_dedup);
15555 #endif
15556 Py_DECREF(varnames_tuple);
15557 return code_obj;
15558}
15559
15560/* DecompressString */
15561CYTHON_UNUSED
15562static CYTHON_SMALL_CODE PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo) {
15563#ifdef __Pyx_DecompressString_UNUSED
15564 CYTHON_UNUSED_VAR(s);
15565 CYTHON_UNUSED_VAR(length);
15566 CYTHON_UNUSED_VAR(algo);
15567 return NULL;
15568#else
15569 PyObject *module = NULL, *decompress, *compressed_bytes, *decompressed;
15570 const char* module_name = algo == 3 ? "compression.zstd" : algo == 2 ? "bz2" : "zlib";
15571 PyObject *methodname = PyUnicode_FromString("decompress");
15572 if (unlikely(!methodname)) return NULL;
15573 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
15574 if (algo == 3) {
15575 PyObject *fromlist = Py_BuildValue("[O]", methodname);
15576 if (unlikely(!fromlist)) goto bad;
15577 module = PyImport_ImportModuleLevel("compression.zstd", NULL, NULL, fromlist, 0);
15578 Py_DECREF(fromlist);
15579 } else
15580 #endif
15581 module = PyImport_ImportModule(module_name);
15582 if (unlikely(!module)) goto import_failed;
15583 decompress = PyObject_GetAttr(module, methodname);
15584 if (unlikely(!decompress)) goto import_failed;
15585 {
15586 #ifdef __cplusplus
15587 char *memview_bytes = const_cast<char*>(s);
15588 #else
15589 #if defined(__clang__)
15590 #pragma clang diagnostic push
15591 #pragma clang diagnostic ignored "-Wcast-qual"
15592 #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
15593 #pragma GCC diagnostic push
15594 #pragma GCC diagnostic ignored "-Wcast-qual"
15595 #endif
15596 char *memview_bytes = (char*) s;
15597 #if defined(__clang__)
15598 #pragma clang diagnostic pop
15599 #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
15600 #pragma GCC diagnostic pop
15601 #endif
15602 #endif
15603 #if CYTHON_COMPILING_IN_LIMITED_API && !defined(PyBUF_READ)
15604 int memview_flags = 0x100;
15605 #else
15606 int memview_flags = PyBUF_READ;
15607 #endif
15608 compressed_bytes = PyMemoryView_FromMemory(memview_bytes, length, memview_flags);
15609 }
15610 if (unlikely(!compressed_bytes)) {
15611 Py_DECREF(decompress);
15612 goto bad;
15613 }
15614 decompressed = PyObject_CallFunctionObjArgs(decompress, compressed_bytes, NULL);
15615 Py_DECREF(compressed_bytes);
15616 Py_DECREF(decompress);
15617 Py_DECREF(module);
15618 Py_DECREF(methodname);
15619 return decompressed;
15620import_failed:
15621 PyErr_Format(PyExc_ImportError,
15622 "Failed to import '%.20s.decompress' - cannot initialise module strings. "
15623 "String compression was configured with the C macro 'CYTHON_COMPRESS_STRINGS=%d'.",
15624 module_name, algo);
15625bad:
15626 Py_XDECREF(module);
15627 Py_DECREF(methodname);
15628 return NULL;
15629#endif
15630}
15631
15632/* DecompressString_LZSS */
15633#ifndef __Pyx_DecompressString_LZSS_UNUSED
15634CYTHON_UNUSED
15635static CYTHON_SMALL_CODE size_t __pyx_lzss_decompress(const uint8_t* src, uint8_t* dst, size_t dst_len) {
15636 size_t pos = 0, out_pos = 0;
15637 while (1) {
15638 uint32_t flags = src[pos++] | 0xFF00;
15639 while (flags & 0x100) {
15640 if (flags & 1) {
15641 dst[out_pos++] = src[pos++];
15642 } else {
15643 uint32_t lo = src[pos++], hi = src[pos++];
15644 uint32_t end_offset_of_last_occurrence, match_length;
15645 if (!(lo & 0x80)) {
15646 end_offset_of_last_occurrence = lo;
15647 match_length = hi;
15648 } else if (!(hi & 0x80)) {
15649 end_offset_of_last_occurrence = 0x80 + (((hi << 2) & 0x180) | (lo & 0x7F));
15650 match_length = hi & 0x1F;
15651 } else {
15652 end_offset_of_last_occurrence = 0x80 + ((hi & 0x7F) << 7 | (lo & 0x7F));
15653 match_length = src[pos++];
15654 }
15655 match_length += 3;
15656 size_t ref_pos = out_pos - end_offset_of_last_occurrence - match_length;
15657 memcpy(dst + out_pos, dst + ref_pos, match_length);
15658 out_pos += match_length;
15659 }
15660 if (out_pos >= dst_len) return pos;
15661 flags >>= 1;
15662 }
15663 }
15664}
15665#endif
15666static CYTHON_SMALL_CODE PyObject *__Pyx_DecompressString_LZSS(const char *s, size_t compressed_length, size_t uncompressed_length) {
15667#ifdef __Pyx_DecompressString_LZSS_UNUSED
15668 CYTHON_UNUSED_VAR(s);
15669 CYTHON_UNUSED_VAR(compressed_length);
15670 CYTHON_UNUSED_VAR(uncompressed_length);
15671 return NULL;
15672#else
15673 PyObject *result;
15674 unsigned char *result_data;
15675 size_t src_length;
15676 result = PyBytes_FromStringAndSize(NULL, (Py_ssize_t) uncompressed_length);
15677 if (unlikely(!result)) return NULL;
15678 result_data = __Pyx_PyBytes_AsWritableUString(result);
15679 if (unlikely(!result_data)) goto bad;
15680 src_length = __pyx_lzss_decompress((const uint8_t*) s, result_data, uncompressed_length);
15681 if (unlikely(src_length != compressed_length)) goto decompression_failed;
15682 return result;
15683decompression_failed:
15684 PyErr_SetString(PyExc_RuntimeError, "LZSS string data decompression failed");
15685bad:
15686 Py_DECREF(result);
15687 return NULL;
15688#endif
15689}
15690
15691#include <string.h>
15692static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
15693 size_t len = strlen(s);
15694 if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) {
15695 PyErr_SetString(PyExc_OverflowError, "byte string is too long");
15696 return -1;
15697 }
15698 return (Py_ssize_t) len;
15699}
15700static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
15701 Py_ssize_t len = __Pyx_ssize_strlen(c_str);
15702 if (unlikely(len < 0)) return NULL;
15703 return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
15704}
15705static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) {
15706 Py_ssize_t len = __Pyx_ssize_strlen(c_str);
15707 if (unlikely(len < 0)) return NULL;
15708 return PyByteArray_FromStringAndSize(c_str, len);
15709}
15710static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
15711 Py_ssize_t ignore;
15712 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
15713}
15714#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
15715static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
15716 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
15717#if CYTHON_COMPILING_IN_LIMITED_API
15718 {
15719 const char* result;
15720 Py_ssize_t unicode_length;
15721 CYTHON_MAYBE_UNUSED_VAR(unicode_length); // only for __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
15722 #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
15723 if (unlikely(PyArg_Parse(o, "s#", &result, length) < 0)) return NULL;
15724 #else
15725 result = PyUnicode_AsUTF8AndSize(o, length);
15726 #endif
15727 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
15728 unicode_length = PyUnicode_GetLength(o);
15729 if (unlikely(unicode_length < 0)) return NULL;
15730 if (unlikely(unicode_length != *length)) {
15731 PyUnicode_AsASCIIString(o);
15732 return NULL;
15733 }
15734 #endif
15735 return result;
15736 }
15737#else
15738#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
15739 if (likely(PyUnicode_IS_ASCII(o))) {
15740 *length = PyUnicode_GET_LENGTH(o);
15741 return PyUnicode_AsUTF8(o);
15742 } else {
15743 PyUnicode_AsASCIIString(o);
15744 return NULL;
15745 }
15746#else
15747 return PyUnicode_AsUTF8AndSize(o, length);
15748#endif
15749#endif
15750}
15751#endif
15752static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
15753#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
15754 if (PyUnicode_Check(o)) {
15755 return __Pyx_PyUnicode_AsStringAndSize(o, length);
15756 } else
15757#endif
15758 if (PyByteArray_Check(o)) {
15759#if (CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) || (CYTHON_COMPILING_IN_PYPY && (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)))
15760 *length = PyByteArray_GET_SIZE(o);
15761 return PyByteArray_AS_STRING(o);
15762#else
15763 *length = PyByteArray_Size(o);
15764 if (*length == -1) return NULL;
15765 return PyByteArray_AsString(o);
15766#endif
15767 } else
15768 {
15769 char* result;
15770 int r = PyBytes_AsStringAndSize(o, &result, length);
15771 if (unlikely(r < 0)) {
15772 return NULL;
15773 } else {
15774 return result;
15775 }
15776 }
15777}
15778static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
15779 int is_true = x == Py_True;
15780 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
15781 else return PyObject_IsTrue(x);
15782}
15783static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
15784 int retval;
15785 if (unlikely(!x)) return -1;
15786 retval = __Pyx_PyObject_IsTrue(x);
15787 Py_DECREF(x);
15788 return retval;
15789}
15790static PyObject* __Pyx_PyNumber_LongWrongResultType(PyObject* result) {
15791 __Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result));
15792 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
15793 if (unlikely(!result_type_name)) goto bad;
15794 #endif
15795 if (PyLong_Check(result)) {
15796 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
15797 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). "
15798 "The ability to return an instance of a strict subclass of int is deprecated, "
15799 "and may be removed in a future version of Python.",
15800 result_type_name)) {
15801 __Pyx_DECREF_TypeName(result_type_name);
15802 goto bad;
15803 }
15804 __Pyx_DECREF_TypeName(result_type_name);
15805 return result;
15806 }
15807 PyErr_Format(PyExc_TypeError,
15808 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ")",
15809 result_type_name);
15810 __Pyx_DECREF_TypeName(result_type_name);
15811bad:
15812 Py_DECREF(result);
15813 return NULL;
15814}
15815static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) {
15816#if CYTHON_USE_TYPE_SLOTS
15817 PyNumberMethods *m;
15818#endif
15819 PyObject *res = NULL;
15820 if (likely(PyLong_Check(x)))
15821 return __Pyx_NewRef(x);
15822#if CYTHON_USE_TYPE_SLOTS
15823 m = Py_TYPE(x)->tp_as_number;
15824 if (likely(m && m->nb_int)) {
15825 res = m->nb_int(x);
15826 }
15827#else
15828 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
15829 res = PyNumber_Long(x);
15830 }
15831#endif
15832 if (likely(res)) {
15833 if (unlikely(!PyLong_CheckExact(res))) {
15834 return __Pyx_PyNumber_LongWrongResultType(res);
15835 }
15836 }
15837 else if (!PyErr_Occurred()) {
15838 PyErr_SetString(PyExc_TypeError,
15839 "an integer is required");
15840 }
15841 return res;
15842}
15843static CYTHON_INLINE Py_ssize_t __Pyx_PyLong_AsSsize_t(PyObject* b) {
15844 #if CYTHON_USE_PYLONG_INTERNALS
15845 Py_ssize_t ival;
15846 const Py_ssize_t size = __Pyx_PyLong_DigitCount(b);
15847 const int is_neg = __Pyx_PyLong_IsNeg(b);
15848 const digit* digits = __Pyx_PyLong_Digits(b);
15849 if (size == 0) return 0;
15850 #if SIZEOF_SIZE_T * 8 > 1 * PyLong_SHIFT
15851 if (size == 1) {
15852 ival = (Py_ssize_t) (((size_t)digits[0]));
15853 } else
15854 #endif
15855 #if SIZEOF_SIZE_T * 8 > 2 * PyLong_SHIFT
15856 if (size == 2) {
15857 ival = (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
15858 } else
15859 #endif
15860 #if SIZEOF_SIZE_T * 8 > 3 * PyLong_SHIFT
15861 if (size == 3) {
15862 ival = (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
15863 } else
15864 #endif
15865 #if SIZEOF_SIZE_T * 8 > 4 * PyLong_SHIFT
15866 if (size == 4) {
15867 ival = (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
15868 } else
15869 #endif
15870 return PyLong_AsSsize_t(b);
15871 return is_neg ? -ival : ival;
15872 #else
15873 return PyLong_AsSsize_t(b);
15874 #endif
15875}
15876static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
15877 if (likely(PyLong_Check(b))) {
15878 return __Pyx_PyLong_AsSsize_t(b);
15879 } else {
15880 Py_ssize_t ival;
15881 PyObject *x = PyNumber_Index(b);
15882 if (unlikely(!x)) return -1;
15883 ival = __Pyx_PyLong_AsSsize_t(x);
15884 Py_DECREF(x);
15885 return ival;
15886 }
15887}
15888static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
15889 if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
15890 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
15891 } else {
15892 Py_ssize_t ival;
15893 PyObject *x;
15894 x = PyNumber_Index(o);
15895 if (!x) return -1;
15896 ival = PyLong_AsLong(x);
15897 Py_DECREF(x);
15898 return ival;
15899 }
15900}
15901static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) {
15902 CYTHON_UNUSED_VAR(b);
15903 return __Pyx_NewRef(Py_None);
15904}
15905static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
15906 return __Pyx_NewRef(b ? Py_True: Py_False);
15907}
15908static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) {
15909 return PyLong_FromSize_t(ival);
15910}
15911
15912
15913/* MultiPhaseInitModuleState */
15914#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
15915#ifndef CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
15916#if (CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000)
15917 #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 1
15918#else
15919 #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0
15920#endif
15921#endif
15922#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE && !CYTHON_ATOMICS
15923#error "Module state with PEP489 requires atomics. Currently that's one of\
15924 C11, C++11, gcc atomic intrinsics or MSVC atomic intrinsics"
15925#endif
15926#if !CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
15927#define __Pyx_ModuleStateLookup_Lock()
15928#define __Pyx_ModuleStateLookup_Unlock()
15929#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
15930static PyMutex __Pyx_ModuleStateLookup_mutex = {0};
15931#define __Pyx_ModuleStateLookup_Lock() PyMutex_Lock(&__Pyx_ModuleStateLookup_mutex)
15932#define __Pyx_ModuleStateLookup_Unlock() PyMutex_Unlock(&__Pyx_ModuleStateLookup_mutex)
15933#elif defined(__cplusplus) && __cplusplus >= 201103L
15934#include <mutex>
15935static std::mutex __Pyx_ModuleStateLookup_mutex;
15936#define __Pyx_ModuleStateLookup_Lock() __Pyx_ModuleStateLookup_mutex.lock()
15937#define __Pyx_ModuleStateLookup_Unlock() __Pyx_ModuleStateLookup_mutex.unlock()
15938#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201112L) && !defined(__STDC_NO_THREADS__)
15939#include <threads.h>
15940static mtx_t __Pyx_ModuleStateLookup_mutex;
15941static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT;
15942static void __Pyx_ModuleStateLookup_initialize_mutex(void) {
15943 mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain);
15944}
15945#define __Pyx_ModuleStateLookup_Lock()\
15946 call_once(&__Pyx_ModuleStateLookup_mutex_once_flag, __Pyx_ModuleStateLookup_initialize_mutex);\
15947 mtx_lock(&__Pyx_ModuleStateLookup_mutex)
15948#define __Pyx_ModuleStateLookup_Unlock() mtx_unlock(&__Pyx_ModuleStateLookup_mutex)
15949#elif defined(HAVE_PTHREAD_H)
15950#include <pthread.h>
15951static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER;
15952#define __Pyx_ModuleStateLookup_Lock() pthread_mutex_lock(&__Pyx_ModuleStateLookup_mutex)
15953#define __Pyx_ModuleStateLookup_Unlock() pthread_mutex_unlock(&__Pyx_ModuleStateLookup_mutex)
15954#elif defined(_WIN32)
15955#include <Windows.h> // synchapi.h on its own doesn't work
15956static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT;
15957#define __Pyx_ModuleStateLookup_Lock() AcquireSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
15958#define __Pyx_ModuleStateLookup_Unlock() ReleaseSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
15959#else
15960#error "No suitable lock available for CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE.\
15961 Requires C standard >= C11, or C++ standard >= C++11,\
15962 or pthreads, or the Windows 32 API, or Python >= 3.13."
15963#endif
15964typedef struct {
15965 int64_t id;
15966 PyObject *module;
15967} __Pyx_InterpreterIdAndModule;
15968typedef struct {
15969 char interpreter_id_as_index;
15970 Py_ssize_t count;
15971 Py_ssize_t allocated;
15972 __Pyx_InterpreterIdAndModule table[1];
15973} __Pyx_ModuleStateLookupData;
15974#define __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE 32
15975#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
15976static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0;
15977#endif
15978#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
15979static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0;
15980#else
15981static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL;
15982#endif
15983static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound(
15984 __Pyx_InterpreterIdAndModule* table,
15985 Py_ssize_t count,
15986 int64_t interpreterId) {
15987 __Pyx_InterpreterIdAndModule* begin = table;
15988 __Pyx_InterpreterIdAndModule* end = begin + count;
15989 if (begin->id == interpreterId) {
15990 return begin;
15991 }
15992 while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
15993 __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2;
15994 if (halfway->id == interpreterId) {
15995 return halfway;
15996 }
15997 if (halfway->id < interpreterId) {
15998 begin = halfway;
15999 } else {
16000 end = halfway;
16001 }
16002 }
16003 for (; begin < end; ++begin) {
16004 if (begin->id >= interpreterId) return begin;
16005 }
16006 return begin;
16007}
16008static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED void* dummy) {
16009 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
16010 if (interpreter_id == -1) return NULL;
16011#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
16012 __Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
16013 {
16014 __pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
16015 if (likely(data)) {
16016 __Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data);
16017 if (likely(data == new_data)) {
16018 goto read_finished;
16019 }
16020 }
16021 __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
16022 __Pyx_ModuleStateLookup_Lock();
16023 __pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter);
16024 data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
16025 __Pyx_ModuleStateLookup_Unlock();
16026 }
16027 read_finished:;
16028#else
16029 __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data;
16030#endif
16031 __Pyx_InterpreterIdAndModule* found = NULL;
16032 if (unlikely(!data)) goto end;
16033 if (data->interpreter_id_as_index) {
16034 if (interpreter_id < data->count) {
16035 found = data->table+interpreter_id;
16036 }
16037 } else {
16038 found = __Pyx_State_FindModuleStateLookupTableLowerBound(
16039 data->table, data->count, interpreter_id);
16040 }
16041 end:
16042 {
16043 PyObject *result=NULL;
16044 if (found && found->id == interpreter_id) {
16045 result = found->module;
16046 }
16047#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
16048 __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
16049#endif
16050 return result;
16051 }
16052}
16053#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
16054static void __Pyx_ModuleStateLookup_wait_until_no_readers(void) {
16055 while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0);
16056}
16057#else
16058#define __Pyx_ModuleStateLookup_wait_until_no_readers()
16059#endif
16060static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) {
16061 Py_ssize_t to_allocate = (*old_data)->allocated;
16062 while (to_allocate <= interpreter_id) {
16063 if (to_allocate == 0) to_allocate = 1;
16064 else to_allocate *= 2;
16065 }
16066 __Pyx_ModuleStateLookupData *new_data = *old_data;
16067 if (to_allocate != (*old_data)->allocated) {
16068 new_data = (__Pyx_ModuleStateLookupData *)realloc(
16069 *old_data,
16070 sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
16071 if (!new_data) {
16072 PyErr_NoMemory();
16073 return -1;
16074 }
16075 for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) {
16076 new_data->table[i].id = i;
16077 new_data->table[i].module = NULL;
16078 }
16079 new_data->allocated = to_allocate;
16080 }
16081 new_data->table[interpreter_id].module = module;
16082 if (new_data->count < interpreter_id+1) {
16083 new_data->count = interpreter_id+1;
16084 }
16085 *old_data = new_data;
16086 return 0;
16087}
16088static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) {
16089 __Pyx_InterpreterIdAndModule *read = data->table;
16090 __Pyx_InterpreterIdAndModule *write = data->table;
16091 __Pyx_InterpreterIdAndModule *end = read + data->count;
16092 for (; read<end; ++read) {
16093 if (read->module) {
16094 write->id = read->id;
16095 write->module = read->module;
16096 ++write;
16097 }
16098 }
16099 data->count = write - data->table;
16100 for (; write<end; ++write) {
16101 write->id = 0;
16102 write->module = NULL;
16103 }
16104 data->interpreter_id_as_index = 0;
16105}
16106static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED void* dummy) {
16107 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
16108 if (interpreter_id == -1) return -1;
16109 int result = 0;
16110 __Pyx_ModuleStateLookup_Lock();
16111#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
16112 __Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *)
16113 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
16114#else
16115 __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data;
16116#endif
16117 __Pyx_ModuleStateLookupData *new_data = old_data;
16118 if (!new_data) {
16119 new_data = (__Pyx_ModuleStateLookupData *)calloc(1, sizeof(__Pyx_ModuleStateLookupData));
16120 if (!new_data) {
16121 result = -1;
16122 PyErr_NoMemory();
16123 goto end;
16124 }
16125 new_data->allocated = 1;
16126 new_data->interpreter_id_as_index = 1;
16127 }
16128 __Pyx_ModuleStateLookup_wait_until_no_readers();
16129 if (new_data->interpreter_id_as_index) {
16130 if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
16131 result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id);
16132 goto end;
16133 }
16134 __Pyx_State_ConvertFromInterpIdAsIndex(new_data);
16135 }
16136 {
16137 Py_ssize_t insert_at = 0;
16138 {
16139 __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
16140 new_data->table, new_data->count, interpreter_id);
16141 assert(lower_bound);
16142 insert_at = lower_bound - new_data->table;
16143 if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) {
16144 lower_bound->module = module;
16145 goto end; // already in table, nothing more to do
16146 }
16147 }
16148 if (new_data->count+1 >= new_data->allocated) {
16149 Py_ssize_t to_allocate = (new_data->count+1)*2;
16150 new_data =
16151 (__Pyx_ModuleStateLookupData*)realloc(
16152 new_data,
16153 sizeof(__Pyx_ModuleStateLookupData) +
16154 (to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
16155 if (!new_data) {
16156 result = -1;
16157 new_data = old_data;
16158 PyErr_NoMemory();
16159 goto end;
16160 }
16161 new_data->allocated = to_allocate;
16162 }
16163 ++new_data->count;
16164 int64_t last_id = interpreter_id;
16165 PyObject *last_module = module;
16166 for (Py_ssize_t i=insert_at; i<new_data->count; ++i) {
16167 int64_t current_id = new_data->table[i].id;
16168 new_data->table[i].id = last_id;
16169 last_id = current_id;
16170 PyObject *current_module = new_data->table[i].module;
16171 new_data->table[i].module = last_module;
16172 last_module = current_module;
16173 }
16174 }
16175 end:
16176#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
16177 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data);
16178#else
16179 __Pyx_ModuleStateLookup_data = new_data;
16180#endif
16181 __Pyx_ModuleStateLookup_Unlock();
16182 return result;
16183}
16184static int __Pyx_State_RemoveModule(CYTHON_UNUSED void* dummy) {
16185 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
16186 if (interpreter_id == -1) return -1;
16187 __Pyx_ModuleStateLookup_Lock();
16188#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
16189 __Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *)
16190 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
16191#else
16192 __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data;
16193#endif
16194 if (data->interpreter_id_as_index) {
16195 if (interpreter_id < data->count) {
16196 data->table[interpreter_id].module = NULL;
16197 }
16198 goto done;
16199 }
16200 {
16201 __Pyx_ModuleStateLookup_wait_until_no_readers();
16202 __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
16203 data->table, data->count, interpreter_id);
16204 if (!lower_bound) goto done;
16205 if (lower_bound->id != interpreter_id) goto done;
16206 __Pyx_InterpreterIdAndModule *end = data->table+data->count;
16207 for (;lower_bound<end-1; ++lower_bound) {
16208 lower_bound->id = (lower_bound+1)->id;
16209 lower_bound->module = (lower_bound+1)->module;
16210 }
16211 }
16212 --data->count;
16213 if (data->count == 0) {
16214 free(data);
16215 data = NULL;
16216 }
16217 done:
16218#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
16219 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data);
16220#else
16221 __Pyx_ModuleStateLookup_data = data;
16222#endif
16223 __Pyx_ModuleStateLookup_Unlock();
16224 return 0;
16225}
16226#endif
16227
16228/* #### Code section: utility_code_pragmas_end ### */
16229#ifdef _MSC_VER
16230#pragma warning( pop )
16231#endif
16232
16233
16234
16235/* #### Code section: end ### */
16236#endif /* Py_PYTHON_H */
void runfourier()
Definition Fourier.cpp:27
Int n
Definition Headers.h:28
Double T
Definition Headers.h:87
Double r
Definition Headers.h:83
Double U
Definition Headers.h:88
Int number
Definition Headers.h:33
Double f
Definition Headers.h:64
Double s
Definition Headers.h:84
Double * z
Definition Headers.h:49
Double v
Definition Headers.h:95
#define sign(x, y)
Definition jf.h:44
#define c(i)
Definition jf.h:21