-
Notifications
You must be signed in to change notification settings - Fork 6.5k
automl: add base model samples for automl ga #2609
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
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.
Just nits, LGTM. It looks like you ran black over your code, the following styles I strongly disagree with:
- Double quotes
- Additional newlines wrapping parenthesis
The lint check should no longer enforce these styles but you're welcome to adopt them too, just do it consistently.
Also note that by default black will wrap lines at 88 columns, I prefer 80 or 79 as per the authoring guide for python.
model_full_id = client.model_path(project_id, "us-central1", model_id) | ||
response = client.delete_model(model_full_id) | ||
|
||
print("Model deleted. {}".format(response.result())) |
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.
(Optional) As per the Authoring guide, I prefer single quotes over double.
|
||
client = automl.AutoMlClient() | ||
# Get the full path of the model. | ||
model_full_id = client.model_path(project_id, "us-central1", model_id) |
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.
The double quotes look a bit odd.
# Get complete detail of the model evaluation. | ||
response = client.get_model_evaluation(model_evaluation_full_id) | ||
|
||
print("Model evaluation name: {}".format(response.name)) |
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.
Something about the quotes looks wrong.
print("List of model evaluations:") | ||
for evaluation in client.list_model_evaluations(model_full_id, ""): | ||
print("Model evaluation name: {}".format(evaluation.name)) | ||
print( |
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.
Weird print style blocks
print("\tseconds: {}".format(evaluation.create_time.seconds)) | ||
print("\tnanos: {}".format(evaluation.create_time.nanos / 1e9)) | ||
print( | ||
"Evaluation example count: {}".format( |
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.
Weird double quotes
automl/cloud-client/list_models.py
Outdated
from google.cloud import automl | ||
|
||
# TODO(developer): Uncomment and set the following variables | ||
# project_id = 'YOUR_PROJECT_ID' |
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.
If you're adopting double-quotes, use them consistently.
Yea, I usually run Mostly I just started using black after I noticed the generated libraries use it, so I figured I'd conform. |
…e black formatting
Happy to fix the black formatting if we aren't adopting it in our style. |
Meh, there are a lot of people on the team who are in favor of using Black despite all of it's stylistic shortcomings, just because it is easy to run. I'm ok with this style until we have an alternative for auto-formatting. I may look into customizing out the Black features that are triggering my style preferences in particular:
And any others that I find. Ideally, the auto-formatter we adopt should be configurable to our styles. |
…tform/python-docs-samples#2609) * automl: add base model samples for automl ga * Add tests for each file, provide a unique model for each python version for kokoro * Fix version check * Update tests and format * Update deploy_model_test.py * Update license headers, ensure double quotes is used everywhere, leave black formatting
…tform/python-docs-samples#2609) * automl: add base model samples for automl ga * Add tests for each file, provide a unique model for each python version for kokoro * Fix version check * Update tests and format * Update deploy_model_test.py * Update license headers, ensure double quotes is used everywhere, leave black formatting
* automl: add base model samples for automl ga * Add tests for each file, provide a unique model for each python version for kokoro * Fix version check * Update tests and format * Update deploy_model_test.py * Update license headers, ensure double quotes is used everywhere, leave black formatting
* automl: add base model samples for automl ga * Add tests for each file, provide a unique model for each python version for kokoro * Fix version check * Update tests and format * Update deploy_model_test.py * Update license headers, ensure double quotes is used everywhere, leave black formatting
…tform/python-docs-samples#2609) * automl: add base model samples for automl ga * Add tests for each file, provide a unique model for each python version for kokoro * Fix version check * Update tests and format * Update deploy_model_test.py * Update license headers, ensure double quotes is used everywhere, leave black formatting
No description provided.