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

Re-assign correct indices to emptyColumns at table creation #89

Merged
merged 3 commits into from
May 24, 2024

Conversation

Rdornier
Copy link
Contributor

@Rdornier Rdornier commented May 8, 2024

Hello @ppouchin

In some cases, when multiple columns have to be removed from a TableWrapper object, because they are considered as empty columns, wrong columns are removed instead.
I found out that because of the re-indexing performed in this method, the next indices to remove are not correct anymore and it removes the wrong columns (only the first column to remove is correct)

To correct it, I simply subtract the number of columns already removed in the table to the next indices.

Rémy.

Copy link

codecov bot commented May 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.06%. Comparing base (6779455) to head (f45b6b8).
Report is 2 commits behind head on 5_19_0.

Additional details and impacted files
@@             Coverage Diff              @@
##             5_19_0      #89      +/-   ##
============================================
- Coverage     96.11%   96.06%   -0.05%     
- Complexity     1307     1308       +1     
============================================
  Files            46       46              
  Lines          3523     3558      +35     
  Branches        280      283       +3     
============================================
+ Hits           3386     3418      +32     
  Misses           76       76              
- Partials         61       64       +3     

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

@ppouchin
Copy link
Member

Hi!

I'm finishing some code for image analysis and I'll look into it tomorrow.
I really need to refactor the whole table code at one point, as it is quite fat but still limited (cannot have multiple ROI columns for example).

@ppouchin ppouchin changed the base branch from main to 5_19_0 May 23, 2024 14:26
@ppouchin ppouchin self-requested a review May 23, 2024 14:30
@ppouchin
Copy link
Member

ppouchin commented May 23, 2024

You're absolutely right!

Although if the indices are not sorted (however, they should), the current formula may not work properly either.
Alternatively, do you think that processing the columns in reverse order would work as well?

I'm wondering if a test can be added to notice this error if this creeps up again...

@Rdornier
Copy link
Contributor Author

Alternatively, do you think that processing the columns in reverse order would work as well?

Yes, it should work and it is a nice way to handle this.

@ppouchin ppouchin merged commit eb1e317 into GReD-Clermont:5_19_0 May 24, 2024
3 of 4 checks passed
Copy link
Member

@ppouchin ppouchin left a comment

Choose a reason for hiding this comment

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

Done.

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.

2 participants