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

Bounding boxes example #312

Merged
merged 26 commits into from
Dec 6, 2024
Merged

Bounding boxes example #312

merged 26 commits into from
Dec 6, 2024

Conversation

sfmig
Copy link
Contributor

@sfmig sfmig commented Sep 17, 2024

Rebase after #313 is merged

Description

What is this PR

  • Bug fix
  • Addition of a new feature
  • Other

Why is this PR needed?
To demo the bounding boxes' dataset.

What does this PR do?

  • It shows how to load a sample bounding boxes dataset and its structure
  • It shows how to plot bounding boxes using the position and shape arrays
  • It shows different simple options to fill in missing values in the position and shape arrays
  • It also fixes a typo in the input/output documentation re exporting bounding boxes datasets as csv files.

References

Closes #247.

Rebase after #313 is merged

How has this PR been tested?

Docs build locally and test pass locally and in CI.

Is this a breaking change?

No.

Does this PR require an update to the documentation?

No.

Checklist:

  • The code has been tested locally
  • [ n/a ] Tests have been added to cover all new functionality
  • [ n/a ] The documentation has been updated to reflect any changes
  • The code has been formatted with pre-commit

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
21.6% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

Copy link

codecov bot commented Sep 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.78%. Comparing base (e0cdf8e) to head (1d7299f).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #312   +/-   ##
=======================================
  Coverage   99.78%   99.78%           
=======================================
  Files          14       14           
  Lines         932      932           
=======================================
  Hits          930      930           
  Misses          2        2           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sfmig sfmig mentioned this pull request Nov 29, 2024
7 tasks
@sfmig sfmig force-pushed the smg/bboxes-example branch 3 times, most recently from b02435f to a1d17b3 Compare December 2, 2024 17:57
@sfmig sfmig marked this pull request as ready for review December 2, 2024 18:05
@sfmig sfmig requested a review from a team December 2, 2024 18:06
@lochhh lochhh requested review from lochhh and removed request for a team December 2, 2024 18:10
@lochhh
Copy link
Collaborator

lochhh commented Dec 2, 2024

Quality Gate Passed Quality Gate passed

Issues 3 New issues

Need resolving

@sfmig
Copy link
Contributor Author

sfmig commented Dec 3, 2024

hey, thanks for having a look!

From the issues flagged by sonarcloud:

  • two are due to duplicate lines, because I am printing explanatory lines a few times in the example. Namely:
    • print("Position data array (first 14 frames):") and
    • print("Shape data array (first 14 frames):").
  • one is due to commented out code for # sphinx_gallery_thumbnail_number = 2, but this is the syntax to change the default thumbnail shown in the example. We are using the same approach in another example too.

I think for clarity it makes sense to keep the duplicate lines as is and not define a separate variable, but lmk if you disagree.

I cannot retrieve the reports from previous tutorials anymore (examples here and here) but it seems in those cases we skipped three issues too.

Copy link
Member

@niksirbi niksirbi left a comment

Choose a reason for hiding this comment

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

Thank you @sfmig, this is a great example! I left a bunch of comments, many of them nitpicky and/or subjective.

My two substantial points are:

  • I think we should change the name and/or tagline of this example. I don't think that "reindexing" means much to most users
  • we should rely on selecting the data with sel and isel as much as possible, and avoid numpy-style indexing (which is contingent on a certain dimension order).

examples/load_and_reindex_bboxes.py Outdated Show resolved Hide resolved
examples/load_and_reindex_bboxes.py Outdated Show resolved Hide resolved
examples/load_and_reindex_bboxes.py Outdated Show resolved Hide resolved
examples/load_and_reindex_bboxes.py Outdated Show resolved Hide resolved
examples/load_and_reindex_bboxes.py Outdated Show resolved Hide resolved
examples/load_and_reindex_bboxes.py Outdated Show resolved Hide resolved
examples/load_and_reindex_bboxes.py Outdated Show resolved Hide resolved
examples/load_and_reindex_bboxes.py Outdated Show resolved Hide resolved
examples/load_and_reindex_bboxes.py Outdated Show resolved Hide resolved
examples/load_and_reindex_bboxes.py Outdated Show resolved Hide resolved
@niksirbi
Copy link
Member

niksirbi commented Dec 4, 2024

hey, thanks for having a look!

From the issues flagged by sonarcloud:

  • two are due to duplicate lines, because I am printing explanatory lines a few times in the example. Namely:

    • print("Position data array (first 14 frames):") and
    • print("Shape data array (first 14 frames):").
  • one is due to commented out code for # sphinx_gallery_thumbnail_number = 2, but this is the syntax to change the default thumbnail shown in the example. We are using the same approach in another example too.

I think for clarity it makes sense to keep the duplicate lines as is and not define a separate variable, but lmk if you disagree.

I cannot retrieve the reports from previous tutorials anymore (examples here and here) but it seems in those cases we skipped three issues too.

Regarding the sonarclous issues, I agree that you can ignore them in this case. We don't mind some repetition in the examples (it's often a good thing, pedagogically).

@lochhh lochhh removed their request for review December 5, 2024 07:14
@sfmig sfmig force-pushed the smg/bboxes-example branch from 4344ab4 to 9a8f74e Compare December 5, 2024 11:20
Copy link
Member

@niksirbi niksirbi left a comment

Choose a reason for hiding this comment

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

Just 1 comment @sfmig, and after that it's good to merge!

I really like the new plots you've added now.

Copy link

sonarqubecloud bot commented Dec 6, 2024

@sfmig sfmig enabled auto-merge December 6, 2024 12:21
@sfmig sfmig added this pull request to the merge queue Dec 6, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 6, 2024
@niksirbi niksirbi added this pull request to the merge queue Dec 6, 2024
Merged via the queue into main with commit 1387cc1 Dec 6, 2024
18 checks passed
@niksirbi niksirbi deleted the smg/bboxes-example branch December 9, 2024 09:32
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 bounding boxes example
3 participants