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

Fix Bug in add_ncu #196

Merged
merged 4 commits into from
Oct 28, 2024
Merged

Fix Bug in add_ncu #196

merged 4 commits into from
Oct 28, 2024

Conversation

michaelmckinsey1
Copy link
Collaborator

@michaelmckinsey1 michaelmckinsey1 commented Jul 17, 2024

#178 Introduced a bug when chosen_metrics was not provided. When chosen_metrics=None all ncu metrics are added to the perf dataframe. This PR fixes the bug by modifying the check and moving it, where we can check for duplicate columns when chosen_metrics=None aswell.

  • Check type of chosen_metrics before reading NCU
  • Check for duplicate columns after reading NCU, such that if chosen_metrics is None we will know which metrics are present.

@michaelmckinsey1 michaelmckinsey1 added area-thicket Issues and PRs involving Thicket's core Thicket datastructure and associated classes priority-normal Normal priority issues and PRs status-ready-for-review This PR is ready to be reviewed by assigned reviewers type-bug Identifies bugs in issues and identifies bug fixes in PRs labels Jul 17, 2024
@michaelmckinsey1 michaelmckinsey1 self-assigned this Jul 17, 2024
Copy link
Collaborator

@ilumsden ilumsden left a comment

Choose a reason for hiding this comment

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

The revised logic for dupe_cols looks good, but there's a pretty major issue in handling chosen_metrics that could easily break NCUReader if not addressed.

@@ -602,6 +593,15 @@ def _rep_agg_func(col):
if chosen_metrics:
ncu_df = ncu_df[chosen_metrics]
Copy link
Collaborator

Choose a reason for hiding this comment

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

You need to have a type check before doing this. Since you don't validate the type of chosen_metrics anywhere, you could get an input that would cause various parts of the rest of the code to error. Off the top of my head, some scenarios are:

  • Passing a number (e.g., int, float) would cause this line to fail with a KeyError iff there is not a column with an integer or float index
  • Passing a string would cause this line to succeed, but it would also return a Series instead of a DataFrame. This would cause all the code following this line to fail.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

@ilumsden ilumsden left a comment

Choose a reason for hiding this comment

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

LGTM.

@pearce8 this PR is ready for your review

@ilumsden ilumsden added status-approved No more revisions are required on this PR and it is ready for merge and removed status-ready-for-review This PR is ready to be reviewed by assigned reviewers labels Aug 12, 2024
@michaelmckinsey1 michaelmckinsey1 added this to the 2024.2.0 milestone Sep 4, 2024
@slabasan
Copy link
Collaborator

@michaelmckinsey1 Can you please resolve conflicts on this PR? Apologies if I merged these in the wrong order.

Michael Richard Mckinsey and others added 2 commits October 25, 2024 13:13
@michaelmckinsey1 michaelmckinsey1 added status-revisions-needed Revisions have been requested from a reviewer for this PR and removed status-approved No more revisions are required on this PR and it is ready for merge labels Oct 25, 2024
@michaelmckinsey1 michaelmckinsey1 added status-approved No more revisions are required on this PR and it is ready for merge and removed status-revisions-needed Revisions have been requested from a reviewer for this PR labels Oct 25, 2024
@slabasan slabasan merged commit fba7235 into LLNL:develop Oct 28, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-thicket Issues and PRs involving Thicket's core Thicket datastructure and associated classes priority-normal Normal priority issues and PRs status-approved No more revisions are required on this PR and it is ready for merge type-bug Identifies bugs in issues and identifies bug fixes in PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants