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

Fixed analytics report: working time rounding to minimal 1 hour is not applied to annotation speed anymore #7898

Merged
merged 14 commits into from
May 20, 2024

Conversation

bsekachev
Copy link
Member

@bsekachev bsekachev commented May 16, 2024

Motivation and context

Depends on ##7883

How has this been tested?

Checklist

  • I submit my changes into the develop branch
  • I have created a changelog fragment
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • I have linked related issues (see GitHub docs)
  • I have increased versions of npm packages if it is necessary
    (cvat-canvas,
    cvat-core,
    cvat-data and
    cvat-ui)

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.

Summary by CodeRabbit

  • Bug Fixes

    • Corrected an issue where analytic reports showed an incorrect count of objects for skeleton tracks and shapes.
  • Improvements

    • Renamed metrics related to annotation speed from total to average for jobs, tasks, and projects.
    • Updated descriptions for annotation speed metrics to specify the number of objects per hour.
    • Removed unnecessary clamping function for working time statistics.

These changes enhance the accuracy and clarity of analytic reports, providing more meaningful insights into annotation speeds and object counts.

Copy link
Contributor

coderabbitai bot commented May 16, 2024

Walkthrough

The recent changes focus on fixing an issue with object counts in skeleton analytics and updating annotation speed metrics from total to average across jobs, tasks, and projects. This includes renaming classes, updating descriptions, and adjusting calculation logic to reflect average speeds. Additionally, a redundant function for clamping working time statistics was removed.

Changes

File Path Change Summary
changelog.d/20240510_095000_boris_fixed_analytics_for_skeletons.md, changelog.d/20240510_095034_boris_fixed_analytics_for_skeletons.md Addressed issues with incorrect object counts in skeleton analytics.
cvat/apps/analytics_report/report/create.py, cvat/apps/analytics_report/report/derived_metrics/__init__.py Renamed metrics related to annotation speed from total to average. Added modules for average annotation speed metrics, removed total annotation speed modules.
cvat/apps/analytics_report/report/derived_metrics/annotation_speed.py, cvat/apps/analytics_report/report/derived_metrics/average_annotation_speed.py Updated descriptions and calculation logic for annotation speed metrics to show objects per hour. Renamed classes and adjusted titles and descriptions for average annotation speed metrics.
cvat/apps/analytics_report/report/get.py Removed _clamp_working_time(statistics) function.
cvat/apps/analytics_report/report/primary_metrics/annotation_speed.py Updated metric description to specify annotation speed in objects per hour for jobs.

🐰
In fields of code where metrics dance,
We fixed the counts, gave speed a chance.
From totals to averages, speeds now gleam,
Our analytics shine, a coder's dream.
Bugs are squashed, and stats refined,
In the world of data, progress aligned.
🌟


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

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: 13

Out of diff range and nitpick comments (3)
cvat/apps/analytics_report/report/derived_metrics/average_annotation_speed.py (3)

Line range hint 10-27: Consider adding type hints for the calculate method.

    def calculate(self) -> dict:

Line range hint 33-38: Consider adding type hints for the get_empty method.

    def get_empty(self) -> dict:

Line range hint 42-58: Consider adding type hints for the calculate method.

    def calculate(self) -> dict:
Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between f4ee3f9 and 5687e43.
Files selected for processing (8)
  • changelog.d/20240510_095000_boris_fixed_analytics_for_skeletons.md (1 hunks)
  • changelog.d/20240510_095034_boris_fixed_analytics_for_skeletons.md (1 hunks)
  • cvat/apps/analytics_report/report/create.py (5 hunks)
  • cvat/apps/analytics_report/report/derived_metrics/init.py (1 hunks)
  • cvat/apps/analytics_report/report/derived_metrics/annotation_speed.py (2 hunks)
  • cvat/apps/analytics_report/report/derived_metrics/average_annotation_speed.py (5 hunks)
  • cvat/apps/analytics_report/report/get.py (2 hunks)
  • cvat/apps/analytics_report/report/primary_metrics/annotation_speed.py (1 hunks)
Files skipped from review due to trivial changes (3)
  • cvat/apps/analytics_report/report/derived_metrics/annotation_speed.py
  • cvat/apps/analytics_report/report/get.py
  • cvat/apps/analytics_report/report/primary_metrics/annotation_speed.py
Additional Context Used
Ruff (13)
cvat/apps/analytics_report/report/derived_metrics/__init__.py (13)

5-5: .annotation_speed.ProjectAnnotationSpeed imported but unused; consider removing, adding to __all__, or using a redundant alias


5-5: .annotation_speed.TaskAnnotationSpeed imported but unused; consider removing, adding to __all__, or using a redundant alias


6-6: .annotation_time.ProjectAnnotationTime imported but unused; consider removing, adding to __all__, or using a redundant alias


6-6: .annotation_time.TaskAnnotationTime imported but unused; consider removing, adding to __all__, or using a redundant alias


8-8: .average_annotation_speed.JobAverageAnnotationSpeed imported but unused; consider removing, adding to __all__, or using a redundant alias


9-9: .average_annotation_speed.ProjectAverageAnnotationSpeed imported but unused; consider removing, adding to __all__, or using a redundant alias


10-10: .average_annotation_speed.TaskAverageAnnotationSpeed imported but unused; consider removing, adding to __all__, or using a redundant alias


12-12: .base.DerivedMetricBase imported but unused; consider removing, adding to __all__, or using a redundant alias


13-13: .objects.ProjectObjects imported but unused; consider removing, adding to __all__, or using a redundant alias


13-13: .objects.TaskObjects imported but unused; consider removing, adding to __all__, or using a redundant alias


14-14: .total_object_count.JobTotalObjectCount imported but unused; consider removing, adding to __all__, or using a redundant alias


14-14: .total_object_count.ProjectTotalObjectCount imported but unused; consider removing, adding to __all__, or using a redundant alias


14-14: .total_object_count.TaskTotalObjectCount imported but unused; consider removing, adding to __all__, or using a redundant alias

Additional comments not posted (8)
changelog.d/20240510_095000_boris_fixed_analytics_for_skeletons.md (1)

1-4: Changelog entry looks good.

changelog.d/20240510_095034_boris_fixed_analytics_for_skeletons.md (1)

1-4: Changelog entry looks good.

cvat/apps/analytics_report/report/derived_metrics/average_annotation_speed.py (1)

65-66: Class definition looks good.

cvat/apps/analytics_report/report/create.py (5)

17-26: Imports updated correctly to reflect the new metric names.


48-48: JobAverageAnnotationSpeed correctly included in the metrics list.


372-372: JobAverageAnnotationSpeed correctly included in the derived metrics list.


436-436: TaskAverageAnnotationSpeed correctly included in the derived metrics list.


499-499: ProjectAverageAnnotationSpeed correctly included in the derived metrics list.

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

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 5687e43 and e68a471.
Files selected for processing (3)
  • changelog.d/20240516_093233_boris_fixed_annotation_speed.md (1 hunks)
  • changelog.d/20240516_093537_boris_fixed_annotation_speed.md (1 hunks)
  • cvat/apps/analytics_report/report/derived_metrics/average_annotation_speed.py (5 hunks)
Files skipped from review due to trivial changes (1)
  • changelog.d/20240516_093537_boris_fixed_annotation_speed.md
Files skipped from review as they are similar to previous changes (1)
  • cvat/apps/analytics_report/report/derived_metrics/average_annotation_speed.py

bsekachev and others added 3 commits May 16, 2024 09:45
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

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between e68a471 and 80e60d5.
Files selected for processing (2)
  • changelog.d/20240516_093233_boris_fixed_annotation_speed.md (1 hunks)
  • tests/cypress/e2e/features/analytics_pipeline.js (2 hunks)
Files not reviewed due to errors (1)
  • tests/cypress/e2e/features/analytics_pipeline.js (no review received)
Additional Context Used
LanguageTool (1)
changelog.d/20240516_093233_boris_fixed_annotation_speed.md (1)

Near line 3: Did you mean the adverb “anymore”?
Context: ... applied to the annotation speed metric any more (<https://github.com/cvat-ai/cvat/pul...

@@ -0,0 +1,4 @@
### Changed

- Working time rounding to a minimal value of 1 hour is not applied to the annotation speed metric any more
Copy link
Contributor

Choose a reason for hiding this comment

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

Correct the grammar.

- Working time rounding to a minimal value of 1 hour is not applied to the annotation speed metric any more
+ Working time rounding to a minimal value of 1 hour is not applied to the annotation speed metric anymore

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
- Working time rounding to a minimal value of 1 hour is not applied to the annotation speed metric any more
Working time rounding to a minimal value of 1 hour is not applied to the annotation speed metric anymore

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 92.85714% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 83.34%. Comparing base (f4ee3f9) to head (80e60d5).
Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #7898      +/-   ##
===========================================
+ Coverage    83.33%   83.34%   +0.01%     
===========================================
  Files          380      380              
  Lines        40022    40012      -10     
  Branches      3766     3766              
===========================================
- Hits         33353    33349       -4     
+ Misses        6669     6663       -6     
Components Coverage Δ
cvat-ui 79.23% <ø> (+0.03%) ⬆️
cvat-server 87.13% <92.85%> (-0.02%) ⬇️

@azhavoro azhavoro merged commit 1a86ccd into develop May 20, 2024
32 checks passed
@bsekachev bsekachev deleted the bs/fixed_annotation_speed branch May 20, 2024 07:54
@cvat-bot cvat-bot bot mentioned this pull request May 21, 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.

None yet

3 participants