Skip to content

Commit

Permalink
remove agg_type
Browse files Browse the repository at this point in the history
  • Loading branch information
Nate Parsons committed May 1, 2024
1 parent c70f489 commit 1bb560b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
12 changes: 3 additions & 9 deletions featuretools/primitives/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,12 @@ def _get_primitives(primitive_kind):


def get_aggregation_primitives():
"""Returns all aggregation primitives, regardless
of compatibility
"""
"""Returns all aggregation primitives"""
return _get_primitives(featuretools.primitives.AggregationPrimitive)


def get_transform_primitives():
"""Returns all transform primitives, regardless
of compatibility
"""
"""Returns all transform primitives"""
return _get_primitives(featuretools.primitives.TransformPrimitive)


Expand All @@ -57,9 +53,7 @@ def get_all_primitives():


def _get_natural_language_primitives():
"""Returns all Natural Language transform primitives,
regardless of compatibility
"""
"""Returns all Natural Language transform primitives"""
transform_primitives = get_transform_primitives()

def _natural_language_in_input_type(primitive):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,7 @@ class SumTimesN(AggregationPrimitive):
def __init__(self, n):
self.n = n

def get_function(self, agg_type="pandas"):
def get_function(self):
def my_function(values):
return values.sum() * self.n

Expand Down Expand Up @@ -1001,7 +1001,7 @@ class Sum1(AggregationPrimitive):
stack_on_exclude = [Count]
default_value = 0

def get_function(self, agg_type="pandas"):
def get_function(self):
return np.sum

class Sum2(AggregationPrimitive):
Expand All @@ -1014,7 +1014,7 @@ class Sum2(AggregationPrimitive):
stack_on_exclude = [Count]
default_value = 0

def get_function(self, agg_type="pandas"):
def get_function(self):
return np.sum

class Sum3(AggregationPrimitive):
Expand All @@ -1027,7 +1027,7 @@ class Sum3(AggregationPrimitive):
stack_on_exclude = [Count]
default_value = 0

def get_function(self, agg_type="pandas"):
def get_function(self):
return np.sum

f5 = Feature(
Expand Down Expand Up @@ -1139,7 +1139,7 @@ class ErrorPrim(AggregationPrimitive):
input_types = [ColumnSchema(semantic_tags={"numeric"})]
return_type = ColumnSchema(semantic_tags={"numeric"})

def get_function(self, agg_type="pandas"):
def get_function(self):
def error(s):
raise RuntimeError(error_msg)

Expand Down
2 changes: 1 addition & 1 deletion featuretools/tests/primitive_tests/test_direct_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class ThreeMostCommonCat(AggregationPrimitive):
return_type = ColumnSchema(semantic_tags={"category"})
number_output_features = 3

def get_function(self, agg_type="pandas"):
def get_function(self):
def pd_top3(x):
counts = x.value_counts()
counts = counts[counts > 0]
Expand Down

0 comments on commit 1bb560b

Please sign in to comment.