Skip to content

Comments

Disallow duplicate entries in categorical axes #660

Open
Rachit931 wants to merge 14 commits intoscikit-hep:mainfrom
Rachit931:fix-duplicate-categories
Open

Disallow duplicate entries in categorical axes #660
Rachit931 wants to merge 14 commits intoscikit-hep:mainfrom
Rachit931:fix-duplicate-categories

Conversation

@Rachit931
Copy link
Contributor

This PR disallows duplicate entries in categorical axes by validating inputs at axis construction time.

Duplicate categorical entries currently lead to ambiguous indexing behavior. This change raises a ValueError when duplicate categories are provided, preventing such axes from being created.

Tests are added to cover both string and integer categorical axes.

Closes : #644

@Rachit931
Copy link
Contributor Author

I rebased on main to resolve the merge conflict caused by the recent image update in the upstream so that CI could run. No other functional changes were made

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.

[BUG] Ambiguous indexing+ due to duplicate categorical axis entries

1 participant