-
Notifications
You must be signed in to change notification settings - Fork 40
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
Convert '-' to '_' in summary dataframe #215
Conversation
Ach — looks like your editor had string normalisation on, as well as a few other settings that caused unrelated changes (removing some parentheses, changing 1. to 1.0...). Do you think you could find your fix and try again without all the changes? |
Sorry about that, I'd setup the local repository to apply |
Anything else required for this @jni ? |
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.
@ns-rse Sorry, I assumed you were still working on this! Have you looked at the changes tab? There's still many unrelated changes — many look like black, e.g. line length exceeding 80c, 4 space indents...
Sorry @jni I thought I'd caught everything, will sort things out now. |
Applied |
Was scratching my head 🤔 as to why the tests were failing until I realised my fork/branch were behind. Hopefully sorted now. |
@ns-rse cool, this is ready now. I was about to merge but then I got worried that it would be a very disruptive change for our users. I think we should add a keyword argument to deprecate the
if separator is None:
separator = '-';
warnings.warn(
"separator in column name will change to _ in next version; "
"use `separator='-'` to maintain current behaviour and silence this warning; "
"use `separator='_'` to switch to the new behaviour and silence this warning."
)
Actually I might just push the changes directly and then merge. 😂 I hope this solution is ok with you! |
This allows deprecation of the column names
Well I'm glad I did that cos it made me check the docs, which needed to be updated with the new separator. @ns-rse can you sanity-check for me that this is an ok approach? I was a bit annoyed with adding |
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.
Sorry for missing updates to documentation.
I agree that its sensible to deprecate this with warnings and give people the opportunity to phase things out and this looks like a sensible approach. I've never undertaken deprecations before so I've learnt about when to use DeprecationWarning
v FutureWarning
. Do you think skan
might be being used by other developers and warrant a DeprecationWarning
?
One minor suggestion I have is to raise the warning when separator = '-'
is explicitly given as whilst the chances are people will have read the warning at least once if they are explicitly specifying it, it would perhaps be useful to remind them of the need to change existing code.
What you say is the correct approach if we plan to remove support for Probably I would do |
Don't worry, I would have forgotten too if I hadn't |
The pytest-doctestplus plugin might be of some use here. |
No description provided.