-
Notifications
You must be signed in to change notification settings - Fork 909
Restructure primitives directory to use individual primitives files #2331
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
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2331 +/- ##
==========================================
+ Coverage 99.39% 99.41% +0.01%
==========================================
Files 179 310 +131
Lines 19166 19798 +632
==========================================
+ Hits 19051 19683 +632
Misses 115 115
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
sbadithe
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible that we could run into issues with file handling and/or imports if the filename shares its name with a Python built-in? i.e. max.py and max.
That was a problem with |
| from featuretools.primitives.standard.aggregation_primitives.time_since_last import ( | ||
| TimeSinceLast, | ||
| ) | ||
| from featuretools.primitives.standard.aggregation_primitives.trend import Trend |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These can all be relative imports
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a pre-commit hook that converts them all to absolute.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shucks, no worries.
| @@ -0,0 +1,57 @@ | |||
| # flake8: noqa | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure this line can be deleted in every init.py file. I added an ignore to these files in .flake8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't delete it in the files that use the from ... import * approach or we get this linting error:
featuretools/primitives/standard/__init__.py:4:1: F403 'from featuretools.primitives.standard.transform_primitives import *' used; unable to detect undefined names
I was able to remove it from a couple other places though.
I think it might be good to treat |
|
Since we have better namespacing we can rename rolling_primitives_utils.py to utils.py |
Done! |
@sbadithe I renamed all the associated files to include the |
|
Thoughts on shortening the primitive submodules a bit? Going from
to
Not as descriptive but transform and primitive are still in the submodule path |
@rwedge Not opposed to it. Would help make some of the imports more manageable and not split over so many lines I think. |
| @@ -0,0 +1,29 @@ | |||
| from woodwork.column_schema import ColumnSchema | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that num_characters and num_words are moved here
|
I'm wondering if we can put all the stray transform primitives in their own folders as well. I'm okay with this as is. But maybe we could but the email and url ones in thier respective folders. Maybe the Cosine, Tangent, Percentile etc.. in one called math. |
Restructure primitives directory to use individual primitives files
Closes #2179