automl: add base model samples for automl ga#2609
Conversation
gguuss
left a comment
There was a problem hiding this comment.
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.
(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.
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.
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( |
| print("\tseconds: {}".format(evaluation.create_time.seconds)) | ||
| print("\tnanos: {}".format(evaluation.create_time.nanos / 1e9)) | ||
| print( | ||
| "Evaluation example count: {}".format( |
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.
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.