From 2ac635fdd0750b1d93e6832e1256172b549f785c Mon Sep 17 00:00:00 2001 From: Brinton Eldridge Date: Wed, 4 Sep 2024 06:35:14 -0500 Subject: [PATCH] if statement readability update --- python/simulation.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/python/simulation.py b/python/simulation.py index 2521a3780..726fb4ebf 100644 --- a/python/simulation.py +++ b/python/simulation.py @@ -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):