GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — automl: add base model samples for automl ga by nnegrey · Pull Request #2609 · GoogleCloudPlatform/python-docs-samples

Conversation

@nnegrey

@nnegrey nnegrey commented Dec 12, 2019

Copy link
Copy Markdown
Contributor

No description provided.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nnegrey
automl: add base model samples for automl ga
aa30bc7
@blunderbuss-gcf blunderbuss-gcf Bot assigned leahecole Dec 12, 2019
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Dec 12, 2019
nnegrey added 2 commits December 13, 2019 10:19
@nnegrey
Add tests for each file, provide a unique model for each python versi…
cae70ac
…on for kokoro
@nnegrey
Fix version check
28008ff
nnegrey
nnegrey commented Dec 13, 2019
View reviewed changes
Comment thread automl/cloud-client/deploy_model_test.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

nnegrey and others added 3 commits December 18, 2019 14:51
@nnegrey
Update tests and format
8410b9f
@nnegrey
Update deploy_model_test.py
a2ef554
@nnegrey
Merge branch 'master' into automl-ga-base-model-samples
ae0d992
@nnegrey
nnegrey marked this pull request as ready for review December 18, 2019 23:26
@nnegrey
nnegrey requested a review from a team as a code owner December 18, 2019 23:26
gguuss
gguuss approved these changes Dec 18, 2019
View reviewed changes

@gguuss gguuss left a comment

Copy link
Copy Markdown
Contributor

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread automl/cloud-client/delete_model.py
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()))

@gguuss gguuss Dec 18, 2019

Copy link
Copy Markdown
Contributor

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread automl/cloud-client/deploy_model.py

client = automl.AutoMlClient()
# Get the full path of the model.
model_full_id = client.model_path(project_id, "us-central1", model_id)

@gguuss gguuss Dec 18, 2019

Copy link
Copy Markdown
Contributor

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread automl/cloud-client/deploy_model_test.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread automl/cloud-client/get_model_evaluation.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread automl/cloud-client/get_model_evaluation.py
# Get complete detail of the model evaluation.
response = client.get_model_evaluation(model_evaluation_full_id)

print("Model evaluation name: {}".format(response.name))

@gguuss gguuss Dec 18, 2019

Copy link
Copy Markdown
Contributor

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread automl/cloud-client/list_model_evaluations.py
print("List of model evaluations:")
for evaluation in client.list_model_evaluations(model_full_id, ""):
print("Model evaluation name: {}".format(evaluation.name))
print(

@gguuss gguuss Dec 18, 2019

Copy link
Copy Markdown
Contributor

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread automl/cloud-client/list_model_evaluations.py
print("\tseconds: {}".format(evaluation.create_time.seconds))
print("\tnanos: {}".format(evaluation.create_time.nanos / 1e9))
print(
"Evaluation example count: {}".format(

@gguuss gguuss Dec 18, 2019

Copy link
Copy Markdown
Contributor

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread automl/cloud-client/list_model_evaluations_test.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread 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'

@gguuss gguuss Dec 18, 2019

Copy link
Copy Markdown
Contributor

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread automl/cloud-client/undeploy_model_test.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@nnegrey

nnegrey commented Dec 19, 2019

Copy link
Copy Markdown
Contributor Author

Yea, I usually run black *.py -l 79
Yea, I'm not a fan of the two nits you pointed out.

Mostly I just started using black after I noticed the generated libraries use it, so I figured I'd conform.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nnegrey
Update license headers, ensure double quotes is used everywhere, leav…
49667a8
…e black formatting
@nnegrey

nnegrey commented Dec 19, 2019

Copy link
Copy Markdown
Contributor Author

Happy to fix the black formatting if we aren't adopting it in our style.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gguuss

gguuss commented Dec 19, 2019 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Mostly I just started using black after I noticed the generated libraries use it, so I figured I'd conform.

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:

  • Double-quotes
  • The extra newlines at the start / end of ( ... ) blocks
  • Column wrapping at 88
  • The extra ',' characters added to the last members of function definitions on continuations
  • Newlines added to closing )'s

And any others that I find. Ideally, the auto-formatter we adopt should be configurable to our styles.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nnegrey
Merge branch 'master' into automl-ga-base-model-samples
cec993b
@nnegrey
nnegrey merged commit f0a4963 into master Dec 20, 2019
@nnegrey
nnegrey deleted the automl-ga-base-model-samples branch December 20, 2019 15:53
busunkim96 pushed a commit to busunkim96/python-automl that referenced this pull request Aug 7, 2020
@nnegrey
automl: add base model samples for automl ga [(#2609)](GoogleCloudPla…
aec0f96
…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
busunkim96 pushed a commit to googleapis/python-automl that referenced this pull request Aug 11, 2020
@nnegrey @busunkim96
automl: add base model samples for automl ga [(#2609)](GoogleCloudPla…
085920a
…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
arbrown pushed a commit that referenced this pull request Nov 17, 2022
@nnegrey @busunkim96
automl: add base model samples for automl ga [(#2609)](#2609)
45567b6
* 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
@arbrown arbrown mentioned this pull request Nov 17, 2022
migrate code from googleapis/python-automl #8528
Merged
8 tasks
dandhlee pushed a commit that referenced this pull request Nov 17, 2022
@nnegrey @dandhlee
automl: add base model samples for automl ga [(#2609)](#2609)
3a21a89
* 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
parthea pushed a commit to googleapis/google-cloud-python that referenced this pull request Oct 21, 2023
@nnegrey @busunkim96
automl: add base model samples for automl ga [(#2609)](GoogleCloudPla…
76f26cf
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer
@gguuss gguuss gguuss approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@leahecole leahecole

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@nnegrey @gguuss @googlebot @leahecole
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.