Skip to content
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

Add short and long utterances on token count plot #442

Merged
merged 2 commits into from
Feb 17, 2023

Conversation

gabegma
Copy link
Contributor

@gabegma gabegma commented Feb 15, 2023

Resolve #94

Description:

Self-explanatory :)
Screen Shot 2023-02-15 at 2 24 12 PM

Checklist:

You should check all boxes before the PR is ready. If a box does not apply, check it to acknowledge it.

  • ISSUE NUMBER. You linked the issue number (Ex: Resolve #XXX).
  • PRE-COMMIT. You ran pre-commit on all commits, or else, you
    ran pre-commit run --all-files at the end.
  • USER CHANGES. The changes are added to CHANGELOG.md and the documentation, if they impact
    our users.
  • DEV CHANGES.
    • Update the documentation if this PR changes how to develop/launch on the app.
    • Update the README files and our wiki for any big design decisions, if relevant.
    • Add unit tests, docstrings, typing and comments for complex sections.

showarrow=False,
)

# Add thresholds for short and long utterances.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only this code is new, the one above was just moved in an else so it is only computed when data is available.

@gabegma gabegma self-assigned this Feb 16, 2023
Copy link
Contributor

@JosephMarinier JosephMarinier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful! 👌 And useful, I think. 👍

@gabegma gabegma enabled auto-merge (squash) February 16, 2023 23:46
Comment on lines +446 to +454
for threshold, edge, pretty_name, xanchor in zip(
[
syntax_options.short_utterance_max_word + 0.5,
syntax_options.long_utterance_min_word - 0.5,
],
[0, max_x + 1],
["Short utterances", "Long utterances"],
["right", "left"],
):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, that's a detail, but you could avoid the zip() by defining the lists/tuples in the other "direction", like

Suggested change
for threshold, edge, pretty_name, xanchor in zip(
[
syntax_options.short_utterance_max_word + 0.5,
syntax_options.long_utterance_min_word - 0.5,
],
[0, max_x + 1],
["Short utterances", "Long utterances"],
["right", "left"],
):
for threshold, edge, pretty_name, xanchor in (
(syntax_options.short_utterance_max_word + 0.5, 0, "Short utterances", "right"),
(syntax_options.long_utterance_min_word - 0.5, max_x + 1, "Long utterances", "left"),
):

@gabegma gabegma merged commit ddb5094 into main Feb 17, 2023
@gabegma gabegma deleted the ggm/add-short-long-utterances-on-plot branch February 17, 2023 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add short/long utterances thresholds on token count plot
2 participants