Skip to content

Commit

Permalink
docstring for default values function
Browse files Browse the repository at this point in the history
  • Loading branch information
bonneted committed Jan 10, 2025
1 parent 1362634 commit 2d5c942
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions deepxde/utils/internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,15 @@ def get_num_args(func):
return len(params) - ("self" in params)

def has_default_values(func):
"""
Check if the given function has default values for its parameters.
Args:
func (function): The function to inspect.
Returns:
list: A list of boolean values indicating whether each parameter has a default value.
"""
params = inspect.signature(func).parameters.values()
return [param.default is not inspect.Parameter.empty for param in params]

Expand Down

0 comments on commit 2d5c942

Please sign in to comment.