-
Notifications
You must be signed in to change notification settings - Fork 28
fix: modify error message and add warning #250
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
Conversation
Co-authored-by: Andrzej Novak <[email protected]>
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add tests (three expection tests)?
Have added the tests, @LovelyBuggies. |
LGTM now. |
Co-authored-by: Henry Schreiner <[email protected]>
if set(data_dict) != set(range(len(args), self.ndim)): | ||
raise TypeError("All axes must be accounted for in fill") | ||
raise TypeError( | ||
"All axes must be accounted for in fill, you may have used a disallowed name in the axes" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eventually I'd only do this if you have an axis with a disallowed name, but this is fine for now.
I'd eventually make the disallowed_names
a global DISALLOWED_NAMES: Final[set[str]] = {...}
, then we could see if there is any overlap between these, and only suggest the "you may have used a disallowed name in the axes" part if there is a chance of this - most users seeing this error probably are making normal mistakes, not using one of these special names
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh okay, we can make it global after this.
Fixes #233