support callable

pull/105/head
wakamezake 2023-07-11 22:09:17 +09:00
parent 8b79698c2d
commit 946942c6fc
No known key found for this signature in database
1 changed files with 8 additions and 6 deletions

View File

@ -7,19 +7,19 @@
# https://github.com/pfnet-research/xfeat/blob/master/xfeat/helper.py
# -----------------------------------------------------------------------------
# MIT License
#
#
# Copyright (c) 2020 Preferred Networks, Inc.
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@ -30,8 +30,8 @@
# -----------------------------------------------------------------------------
from types import LambdaType, FunctionType
from typing import List, Callable, Union, Tuple
from types import FunctionType, LambdaType
from typing import Callable, List, Tuple, Union
import pandas as pd
from pandas.core.common import get_callable_name
@ -85,6 +85,8 @@ def aggregation(
pass
elif isinstance(agg_method, FunctionType):
pass
elif isinstance(agg_method, Callable):
pass
else:
raise ValueError('Supported types are: {} or {}.'
' Got {} instead.'.format(str, Callable, type(agg_method)))