Skip to content

Commit

Permalink
Merge pull request #339 from paquiteau/rm-args
Browse files Browse the repository at this point in the history
refactor: remove add_args_kwargs.
  • Loading branch information
paquiteau authored Feb 19, 2024
2 parents 753adbc + 557023e commit d37e1e4
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 69 deletions.
2 changes: 1 addition & 1 deletion modopt/base/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
"""

__all__ = ['np_adjust', 'transform', 'types', 'wrappers', 'observable']
__all__ = ['np_adjust', 'transform', 'types', 'observable']
20 changes: 1 addition & 19 deletions modopt/base/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@
"""

import numpy as np

from modopt.base.wrappers import add_args_kwargs
from modopt.interface.errors import warn


def check_callable(input_obj, add_agrs=True):
def check_callable(input_obj):
"""Check input object is callable.
This method checks if the input operator is a callable funciton and
Expand All @@ -25,30 +23,14 @@ def check_callable(input_obj, add_agrs=True):
----------
input_obj : callable
Callable function
add_agrs : bool, optional
Option to add support for agrs and kwargs (default is ``True``)
Returns
-------
function
Function wrapped by ``add_args_kwargs``
Raises
------
TypeError
For invalid input type
See Also
--------
modopt.base.wrappers.add_args_kwargs : wrapper used
"""
if not callable(input_obj):
raise TypeError('The input object must be a callable function.')

if add_agrs:
input_obj = add_args_kwargs(input_obj)

return input_obj


Expand Down
49 changes: 0 additions & 49 deletions modopt/base/wrappers.py

This file was deleted.

0 comments on commit d37e1e4

Please sign in to comment.