Skip to content

Commit

Permalink
Changes to _eval_step_func (#2895)
Browse files Browse the repository at this point in the history
* changes to _eval_step_func

* Update simulation.py

* double to single quotes

* incorrect if statement

* reverted _eval_step_func, rm get_name_args, edited get_num_args

* Update python/simulation.py

* Update python/simulation.py

* Update python/simulation.py

* if statement readability update

* added space from pre-check

---------

Co-authored-by: Steven G. Johnson <[email protected]>
  • Loading branch information
kombatEldridge and stevengj authored Sep 5, 2024
1 parent bfd134f commit 1f77440
Showing 1 changed file with 7 additions and 5 deletions.
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

0 comments on commit 1f77440

Please sign in to comment.