Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove make_trans_primitive and make_agg_primitive functions #1970

Merged
merged 13 commits into from
Mar 23, 2022

Conversation

thehomebrewnerd
Copy link
Contributor

Remove make_trans_primitive and make_agg_primitive functions

Closes #1953

@thehomebrewnerd thehomebrewnerd marked this pull request as draft March 18, 2022 15:47
@codecov
Copy link

codecov bot commented Mar 18, 2022

Codecov Report

Merging #1970 (579d3e8) into main (e565ec9) will increase coverage by 0.09%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1970      +/-   ##
==========================================
+ Coverage   98.99%   99.08%   +0.09%     
==========================================
  Files         146      143       -3     
  Lines       16477    16369     -108     
==========================================
- Hits        16311    16219      -92     
+ Misses        166      150      -16     
Impacted Files Coverage Δ
featuretools/feature_base/feature_base.py 96.88% <ø> (ø)
featuretools/primitives/api.py 100.00% <ø> (ø)
...ools/primitives/base/aggregation_primitive_base.py 100.00% <ø> (ø)
...etools/primitives/base/transform_primitive_base.py 100.00% <ø> (ø)
featuretools/primitives/base/api.py 100.00% <100.00%> (ø)
featuretools/primitives/base/primitive_base.py 96.25% <100.00%> (-0.10%) ⬇️
...e_tests/bad_primitive_files/multiple_primitives.py 100.00% <100.00%> (ø)
...rimitive_tests/primitives_to_install/custom_max.py 100.00% <100.00%> (ø)
...imitive_tests/primitives_to_install/custom_mean.py 100.00% <100.00%> (ø)
...rimitive_tests/primitives_to_install/custom_sum.py 100.00% <100.00%> (ø)
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e565ec9...579d3e8. Read the comment docs.

@thehomebrewnerd thehomebrewnerd marked this pull request as ready for review March 21, 2022 13:52
@thehomebrewnerd thehomebrewnerd requested a review from a team March 21, 2022 13:52
@thehomebrewnerd
Copy link
Contributor Author

Changing from make_trans_primitive and make_agg_primitive function to defining custom classes resulted in several new uncovered lines of code. This seems to be because many of the primitives that were defined using these functions were only tested in DFS and were never used in calculate feature matrix so many of the primitive functions are not being called.

We have a few options for this - I'm not sure what's best:

  1. Leave everything as is with the uncovered new lines
  2. Remove the unused primitive functions
  3. Mark these primitive functions with # pragma: no cover and leave in place

@rwedge
Copy link
Contributor

rwedge commented Mar 22, 2022

def get_arguments(self):
values = []
args = signature(self.__class__).parameters.items()
for name, arg in args:
# skip if not a standard argument (e.g. excluding *args and **kwargs)
if arg.kind != arg.POSITIONAL_OR_KEYWORD:
continue

the continue line is no longer getting covered

@thehomebrewnerd
Copy link
Contributor Author

def get_arguments(self):
values = []
args = signature(self.__class__).parameters.items()
for name, arg in args:
# skip if not a standard argument (e.g. excluding *args and **kwargs)
if arg.kind != arg.POSITIONAL_OR_KEYWORD:
continue

the continue line is no longer getting covered

Went ahead and removed this if block that was not getting covered. It was previously getting hit by the test test_time_since_last_custom in test_agg_feats.py. Seems that this was perhaps required as a results of the way make_agg_primitive worked, as it no longer gets hit by the updated test.

Copy link
Contributor

@tamargrey tamargrey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@gsheni gsheni merged commit cef61bc into main Mar 23, 2022
@gsheni gsheni deleted the remove-make-funcs branch March 23, 2022 20:03
@thehomebrewnerd thehomebrewnerd mentioned this pull request Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove make_trans_primitive and make_agg_primitive function
4 participants