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

Update docs for query performance mode #5070

Merged
merged 4 commits into from
Nov 7, 2024
Merged

Conversation

CamronStaley
Copy link
Contributor

@CamronStaley CamronStaley commented Nov 7, 2024

What changes are proposed in this pull request?

Update docs for query performance mode

How is this patch tested? If it is not, please explain why.

local dev

Release Notes

Is this a user-facing change that should be mentioned in the release notes?

  • No. You can skip the rest of this section.
  • Yes. Give a description of this change to be included in the release
    notes for FiftyOne users.

(Details in 1-2 sentences. You can just refer to another PR with a description
if this PR is part of a larger change.)

What areas of FiftyOne does this PR affect?

  • App: FiftyOne application changes
  • Build: Build and test infrastructure changes
  • Core: Core fiftyone Python library changes
  • Documentation: FiftyOne documentation changes
  • Other

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced a Query Performance mode for optimizing query handling in the app.
    • Added configuration options for default_query_performance and enable_query_performance.
  • Bug Fixes

    • Enhanced logic for displaying the QueryPerformanceToast to show only when relevant data is available.
  • Documentation

    • Updated user guides to reflect changes in session management and performance optimization.
    • Improved clarity and organization of configuration documentation.

@CamronStaley CamronStaley self-assigned this Nov 7, 2024
Copy link
Contributor

coderabbitai bot commented Nov 7, 2024

Warning

Rate limit exceeded

@CamronStaley has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 16 minutes and 51 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 49b7c95 and 89f97d5.

Walkthrough

The changes in this pull request involve updates to the QueryPerformanceToast component, enhancing its logic by integrating a new state variable queryPerformance derived from Recoil state. This modification affects the rendering conditions of the toast notification. Additionally, the documentation for the FiftyOne App has been significantly revised, particularly regarding session management and performance optimization, including renaming terms and updating configuration options. The AppConfig class in the configuration file has also been modified, removing the lightning_threshold attribute and changing the default value of default_query_performance.

Changes

File Path Change Summary
app/packages/core/src/components/QueryPerformanceToast.tsx Added queryPerformance state variable; modified rendering logic to include queryPerformance.
docs/source/user_guide/app.rst Updated documentation for session management and performance; renamed "Lightning mode" to "Query Performance mode" and added examples.
docs/source/user_guide/config.rst Added default_query_performance and enable_query_performance fields; removed lightning_threshold.
fiftyone/core/config.py Removed lightning_threshold from AppConfig; changed default value of default_query_performance from False to True.

Possibly related PRs

Suggested labels

documentation

Suggested reviewers

  • minhtuev
  • benjaminpkane

🐰 In the meadow, a toast did rise,
With query performance, oh what a surprise!
A state so bright, it lights the way,
For filtering data, come what may.
In the guide, new paths we find,
To optimize queries, oh so kind!
🌼✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@@ -57,7 +58,7 @@ const QueryPerformanceToast = ({
throw new Error("no query performance element");
}

if (!shown || disabled) {
if (!shown || disabled || !queryPerformance) {
Copy link
Contributor

@minhtuev minhtuev Nov 7, 2024

Choose a reason for hiding this comment

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

if QP mode is False, we won't be showing the toast 👍 maybe add a comment here to explain this logic

:ref:`App config <configuring-fiftyone-app>`, or for a particular dataset by
clicking on the "Gear" icon above the sample grid in the App.

.. note::

When lightning mode is enabled through the "Gear" icon in the App, the
When query performance mode is enabled through the "Gear" icon in the App, the
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to keep Query Performance or query performance for consistency?

Copy link
Contributor

Choose a reason for hiding this comment

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

Good point. Note the language can and may change after product feedback

minhtuev
minhtuev previously approved these changes Nov 7, 2024
Copy link
Contributor

@minhtuev minhtuev left a comment

Choose a reason for hiding this comment

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

Small comments otherwise LGTM

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (2)
app/packages/core/src/components/QueryPerformanceToast.tsx (1)

61-61: Add a comment explaining the queryPerformance condition

While the logic is correct, it would be helpful to add a comment explaining why we check for queryPerformance. This maintains code clarity for future developers.

+ // Only show the toast when query performance mode is enabled and relevant
  if (!shown || disabled || !queryPerformance) {
docs/source/user_guide/app.rst (1)

Line range hint 615-630: Consider adding a note about index creation timing

While the documentation about compound indexes for grouped datasets is accurate, it would be helpful to mention that creating indexes before adding samples is more efficient.

Consider adding a note like:

    dataset = foz.load_zoo_dataset("quickstart-groups")

+   # Note: Creating indexes before adding samples is more efficient
    # Index a specific field
    dataset.create_index("ground_truth.detections.label")
    dataset.create_index([("group.name", 1), ("ground_truth.detections.label", 1)])
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 27d8ae3 and 49b7c95.

⛔ Files ignored due to path filters (2)
  • docs/source/images/app/app-lightning-mode.gif is excluded by !**/*.gif, !**/*.gif
  • docs/source/images/app/app-query-performance-mode.gif is excluded by !**/*.gif, !**/*.gif
📒 Files selected for processing (4)
  • app/packages/core/src/components/QueryPerformanceToast.tsx (2 hunks)
  • docs/source/user_guide/app.rst (6 hunks)
  • docs/source/user_guide/config.rst (3 hunks)
  • fiftyone/core/config.py (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
app/packages/core/src/components/QueryPerformanceToast.tsx (1)

Pattern **/*.{ts,tsx}: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.

🔇 Additional comments (8)
app/packages/core/src/components/QueryPerformanceToast.tsx (1)

41-41: LGTM: Clean state management implementation

The new Recoil state integration is well-implemented using the appropriate hook and follows React conventions.

fiftyone/core/config.py (2)

361-361: LGTM: Default query performance mode enabled by default

The change to enable query performance mode by default (True) aligns with the transition from "Lightning mode" to "Query Performance mode" and improves the out-of-the-box performance for users.


358-362: Verify the impact of removed lightning_threshold

The AI summary indicates that lightning_threshold was removed. Let's verify that all references to this attribute have been properly cleaned up.

✅ Verification successful

Let me gather more context about the lightning mode references to ensure we have a complete picture.


The removal of lightning_threshold is clean and safe

The codebase scan shows that while there are still references to "lightning" features (like the lightning resolver and lightning mode in the app), there are no remaining references to the specific lightning_threshold configuration parameter that was removed. The existing lightning-related code serves different functionality and is not impacted by this removal.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining references to lightning_threshold
rg -i "lightning_threshold"

# Search for any remaining references to "Lightning mode" in documentation
rg -i "lightning.?mode"

Length of output: 724


Script:

#!/bin/bash
# Search for any remaining references to lightning in the app configuration
ast-grep --pattern 'lightning'

# Check for any references in Python files
rg -t py 'lightning'

# Look for any configuration related to lightning in JSON/YAML files
rg -t json -t yaml 'lightning'

Length of output: 2458

docs/source/user_guide/config.rst (1)

671-678: LGTM! Well-documented configuration options.

The new query performance configuration options are clearly documented with appropriate descriptions, environment variables, and default values. The cross-references to additional documentation are helpful.

docs/source/user_guide/app.rst (4)

522-528: LGTM: Clear introduction to Query Performance mode

The introduction effectively explains what Query Performance mode is and how it can be enabled. The documentation is clear and accurate.


534-535: LGTM: Clear persistence behavior note

The note clearly explains how the Query Performance mode setting persists in the browser for each dataset.


Line range hint 537-605: LGTM: Well-documented example with BDD100K dataset

The example effectively demonstrates:

  • How to load a dataset
  • How to create an index
  • How to enable Query Performance mode
    The code snippets and explanations are clear and accurate.

Line range hint 647-684: LGTM: Comprehensive coverage of wildcard indexing

The documentation thoroughly covers:

  • Global wildcard indexing
  • Field-specific wildcard indexing
  • Important warnings about RAM usage
  • Special considerations for video datasets

Comment on lines +812 to +814
"default_query_performance": true,
"disable_frame_filtering": false,
"enable_query_performance": true,
Copy link
Contributor

@coderabbitai coderabbitai bot Nov 7, 2024

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix duplicate configuration option in CLI example.

The disable_frame_filtering option appears twice in the CLI example output. Remove the duplicate entry to maintain consistency with the Python example.

            "default_query_performance": true,
            "disable_frame_filtering": false,
            "enable_query_performance": true,
            "loop_videos": false,
            "media_fallback": false,
-           "disable_frame_filtering": false,
            "multicolor_keypoints": false,

Committable suggestion skipped: line range outside the PR's diff.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good bot

Copy link
Contributor

Choose a reason for hiding this comment

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

@CamronStaley, glad I could help!


If you found this review helpful, would you consider giving us a shout-out on X?
Thank you for using CodeRabbit!

findtopher
findtopher previously approved these changes Nov 7, 2024
Copy link
Member

@findtopher findtopher left a comment

Choose a reason for hiding this comment

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

Looks like a reasonable change post dev-cut to me

@CamronStaley CamronStaley dismissed stale reviews from findtopher and minhtuev via 89f97d5 November 7, 2024 20:58
Copy link
Member

@findtopher findtopher left a comment

Choose a reason for hiding this comment

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

🔩

@CamronStaley CamronStaley merged commit 2b76d3f into release/v1.1.0 Nov 7, 2024
12 of 13 checks passed
@CamronStaley CamronStaley deleted the qp/docs branch November 7, 2024 21:45
sashankaryal pushed a commit that referenced this pull request Nov 15, 2024
* update documentation for qp mode

* update video

* remove missed lightning threshold references

* remove duplicate
@coderabbitai coderabbitai bot mentioned this pull request Dec 7, 2024
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.

4 participants