Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to _eval_step_func #2895

Merged
merged 11 commits into from
Sep 5, 2024
12 changes: 7 additions & 5 deletions python/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""

import functools
import inspect
import math
import numbers
import os
Expand Down Expand Up @@ -93,11 +94,12 @@ def fix_dft_args(args, i):


def get_num_args(func):
return (
2
if isinstance(func, Harminv) or isinstance(func, PadeDFT)
else func.__code__.co_argcount
)
if isinstance(func, Harminv) or isinstance(func, PadeDFT):
return 2
elif inspect.ismethod(func):
return func.__code__.co_argcount - 1 # remove 'self' from count
else:
return func.__code__.co_argcount


def vec(*args):
Expand Down