-
Notifications
You must be signed in to change notification settings - Fork 87
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
Clean up returned Codegen code #1371
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1371 +/- ##
==========================================
- Coverage 99.95% 99.95% -0.00%
==========================================
Files 213 213
Lines 13938 13936 -2
==========================================
- Hits 13931 13929 -2
Misses 7 7
Continue to review full report at Codecov.
|
@@ -170,9 +170,6 @@ def generate_pipeline_code(element): | |||
raise ValueError("Element must be a pipeline instance, received {}".format(type(element))) | |||
|
|||
component_graph_string = ', '.join([com.__class__.__name__ if com.__class__ not in all_components() else "'{}'".format(com.name) for com in element.component_graph]) | |||
import_strings = [com.__class__.__name__ for com in element.component_graph if com.__class__ in all_components()] |
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.
Removed this because for EvalML components, we don't need to import them in order to reference and use them in the component graph of a pipeline
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.
nice!
e287dcf
to
d5b6181
Compare
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.
LGTM!
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.
🚢 !
@@ -189,15 +188,15 @@ def generate_pipeline_code(element): | |||
pipeline_string = "\t" + "\n\t".join(pipeline_list) + "\n" if len(pipeline_list) else "" | |||
# create the base string for the pipeline | |||
base_string = "\nclass {0}({1}):\n" \ | |||
"\tcomponent_graph = [{2}]\n" \ | |||
"\tcomponent_graph = [\n\t\t{2}\n\t]\n" \ |
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.
Nice!
'\nparameters = {\n\t"Imputer": {\n\t\t"categorical_impute_strategy": "most_frequent",\n\t\t"numeric_impute_strategy": "mean",\n\t\t"categorical_fill_value": None,\n\t\t"numeric_fill_value": None\n\t},' \ | ||
'\n\t"Random Forest Classifier": {\n\t\t"n_estimators": 100,\n\t\t"max_depth": 6,\n\t\t"n_jobs": -1\n\t}\n}\n' \ | ||
'pipeline = MockBinaryPipeline(parameters)' | ||
pipeline = generate_pipeline_code(mock_binary_pipeline) |
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.
Looks good to me
Arghh codecov!!! You only touched files with 100% coverage. I have no idea why codecov would complain about this... will look further. Merging! |
Oops when I merged somehow my browser filled in the commit text as "Fix CLA" 🤦 |
@dsherry Codecov is failing because the total number of lines in evalml have decreased by 2, so the percentage overall decreased. I'm running into the same thing in #1388 😅 |
fix #1375
Added formatting for code generation (both for param dictionary and component graph). Remove unnecessary import code from
generate_code_pipelines