Skip to content

Commit

Permalink
if statement readability update
Browse files Browse the repository at this point in the history
  • Loading branch information
kombatEldridge committed Sep 4, 2024
1 parent 0870998 commit 2ac635f
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions python/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +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 - 1 # first argument is "self"
if inspect.ismethod(func)
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

0 comments on commit 2ac635f

Please sign in to comment.