затем я получил ошибку, вызванную numba, которая утверждает, что вызов параметров не соответствует определенной функции, что приводит к выходу индекса за пределы диапазона, следующее:
/usr/local/bin/python3.13 /Users/niuyingkai/PycharmProjects/PT-formula/2026 prob 7 liquid solid interaction.py
Traceback (most recent call last):
File "/Users/niuyingkai/PycharmProjects/PT-formula/2026 prob 7 liquid solid interaction.py", line 174, in
upper_layer_viscous_increment_term, solid_angular_velocity_viscous_increment_term = solid_liquid_layer_angular_velocity_change(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
viscosity=water_viscosity,
^^^^^^^^^^^^^^^^^^^^^^^^^^
......
second_liquid_layer_angular_velocity=water_angular_velocity_current[water_layer_num-2],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/dispatcher.py", line 443, in _compile_for_args
raise e
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/dispatcher.py", line 376, in _compile_for_args
return_val = self.compile(tuple(argtypes))
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/dispatcher.py", line 908, in compile
cres = self._compiler.compile(args, return_type)
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/dispatcher.py", line 80, in compile
status, retval = self._compile_cached(args, return_type)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/dispatcher.py", line 94, in _compile_cached
retval = self._compile_core(args, return_type)
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/dispatcher.py", line 107, in _compile_core
cres = compiler.compile_extra(self.targetdescr.typing_context,
self.targetdescr.target_context,
......
flags=flags, locals=self.locals,
pipeline_class=self.pipeline_class)
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/compiler.py", line 739, in compile_extra
return pipeline.compile_extra(func)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/compiler.py", line 439, in compile_extra
return self._compile_bytecode()
~~~~~~~~~~~~~~~~~~~~~~^^
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/compiler.py", line 505, in _compile_bytecode
return self._compile_core()
~~~~~~~~~~~~~~~~~~^^
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/compiler.py", line 481, in _compile_core
raise e
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/compiler.py", line 473, in _compile_core
pm.run(self.state)
~~~~~~^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/compiler_machinery.py", line 363, in run
raise e
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/compiler_machinery.py", line 356, in run
self._runPass(idx, pass_inst, state)
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/compiler_lock.py", line 35, in _acquire_compile_lock
return func(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/compiler_machinery.py", line 311, in _runPass
mutated |= check(pss.run_pass, internal_state)
~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/compiler_machinery.py", line 272, in check
mangled = func(compiler_state)
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/typed_passes.py", line 114, in run_pass
typemap, return_type, calltypes, errs = type_inference_stage(
~~~~~~~~~~~~~~~~~~~~^
state.typingctx,
^^^^^^^^^^^^^^^^
......
state.locals,
^^^^^^^^^^^^^
raise_errors=self._raise_errors)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/typed_passes.py", line 95, in type_inference_stage
errs = infer.propagate(raise_errors=raise_errors)
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/typeinfer.py", line 1075, in propagate
errors = self.constraints.propagate(self)
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/typeinfer.py", line 160, in propagate
constraint(typeinfer)
~~~~~~~~~~^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/typeinfer.py", line 572, in __call__
self.resolve(typeinfer, typevars, fnty)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/typeinfer.py", line 595, in resolve
sig = typeinfer.resolve_call(fnty, pos_args, kw_args)
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/typeinfer.py", line 1569, in resolve_call
return self.context.resolve_function_type(fnty, pos_args, kw_args)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/typing/context.py", line 279, in resolve_function_type
res = self._resolve_user_function_type(func, args, kws)
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/typing/context.py", line 335, in _resolve_user_function_type
return func.get_call_type(self, args, kws)
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/types/functions.py", line 541, in get_call_type
self.dispatcher.get_call_template(args, kws)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/dispatcher.py", line 315, in get_call_template
pysig, args = self._compiler.fold_argument_types(args, kws)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/dispatcher.py", line 73, in fold_argument_types
args = fold_arguments(self.pysig, args, kws,
normal_handler,
default_handler,
stararg_handler)
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-fpackages/numba/core/typing/templates.py", line 217, in fold_arguments
bind_kws[n] = args[len(kwonly) + idx]
~~~~^^^^^^^^^^^^^^^^^^^
IndexError: tuple index out of range
Process finished with exit code 1
Но я проверил звонок и проблем не было вообще.
В чем проблема? Как это решить?
return 1,2 # Update boundary layer and solid upper_layer_viscous_increment_term, solid_angular_velocity_viscous_increment_term = solid_liquid_layer_angular_velocity_change( 1, 1, 1, [1,1,1], [1,1,1], [1,1,1], [1,1,1], ) [/code] затем я получил ошибку, вызванную numba, которая утверждает, что вызов параметров не соответствует определенной функции, что приводит к выходу индекса за пределы диапазона, следующее: [code]/usr/local/bin/python3.13 /Users/niuyingkai/PycharmProjects/PT-formula/2026 prob 7 liquid solid interaction.py Traceback (most recent call last): File "/Users/niuyingkai/PycharmProjects/PT-formula/2026 prob 7 liquid solid interaction.py", line 174, in upper_layer_viscous_increment_term, solid_angular_velocity_viscous_increment_term = solid_liquid_layer_angular_velocity_change( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ viscosity=water_viscosity, ^^^^^^^^^^^^^^^^^^^^^^^^^^ ...... second_liquid_layer_angular_velocity=water_angular_velocity_current[water_layer_num-2], ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/dispatcher.py", line 443, in _compile_for_args raise e File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/dispatcher.py", line 376, in _compile_for_args return_val = self.compile(tuple(argtypes)) File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/dispatcher.py", line 908, in compile cres = self._compiler.compile(args, return_type) File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/dispatcher.py", line 80, in compile status, retval = self._compile_cached(args, return_type) ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/dispatcher.py", line 94, in _compile_cached retval = self._compile_core(args, return_type) File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/dispatcher.py", line 107, in _compile_core cres = compiler.compile_extra(self.targetdescr.typing_context, self.targetdescr.target_context, ...... flags=flags, locals=self.locals, pipeline_class=self.pipeline_class) File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/compiler.py", line 739, in compile_extra return pipeline.compile_extra(func) ~~~~~~~~~~~~~~~~~~~~~~^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/compiler.py", line 439, in compile_extra return self._compile_bytecode() ~~~~~~~~~~~~~~~~~~~~~~^^ File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/compiler.py", line 505, in _compile_bytecode return self._compile_core() ~~~~~~~~~~~~~~~~~~^^ File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/compiler.py", line 481, in _compile_core raise e File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/compiler.py", line 473, in _compile_core pm.run(self.state) ~~~~~~^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/compiler_machinery.py", line 363, in run raise e File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/compiler_machinery.py", line 356, in run self._runPass(idx, pass_inst, state) ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/compiler_lock.py", line 35, in _acquire_compile_lock return func(*args, **kwargs) File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/compiler_machinery.py", line 311, in _runPass mutated |= check(pss.run_pass, internal_state) ~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/compiler_machinery.py", line 272, in check mangled = func(compiler_state) File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/typed_passes.py", line 114, in run_pass typemap, return_type, calltypes, errs = type_inference_stage( ~~~~~~~~~~~~~~~~~~~~^ state.typingctx, ^^^^^^^^^^^^^^^^ ...... state.locals, ^^^^^^^^^^^^^ raise_errors=self._raise_errors) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/typed_passes.py", line 95, in type_inference_stage errs = infer.propagate(raise_errors=raise_errors) File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/typeinfer.py", line 1075, in propagate errors = self.constraints.propagate(self) File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/typeinfer.py", line 160, in propagate constraint(typeinfer) ~~~~~~~~~~^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/typeinfer.py", line 572, in __call__ self.resolve(typeinfer, typevars, fnty) ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/typeinfer.py", line 595, in resolve sig = typeinfer.resolve_call(fnty, pos_args, kw_args) File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/typeinfer.py", line 1569, in resolve_call return self.context.resolve_function_type(fnty, pos_args, kw_args) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/typing/context.py", line 279, in resolve_function_type res = self._resolve_user_function_type(func, args, kws) File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/typing/context.py", line 335, in _resolve_user_function_type return func.get_call_type(self, args, kws) ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/types/functions.py", line 541, in get_call_type self.dispatcher.get_call_template(args, kws) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/dispatcher.py", line 315, in get_call_template pysig, args = self._compiler.fold_argument_types(args, kws) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/numba/core/dispatcher.py", line 73, in fold_argument_types args = fold_arguments(self.pysig, args, kws, normal_handler, default_handler, stararg_handler) File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-fpackages/numba/core/typing/templates.py", line 217, in fold_arguments bind_kws[n] = args[len(kwonly) + idx] ~~~~^^^^^^^^^^^^^^^^^^^ IndexError: tuple index out of range
Process finished with exit code 1 [/code] Но я проверил звонок и проблем не было вообще. В чем проблема? Как это решить?