-
Notifications
You must be signed in to change notification settings - Fork 86
RangeSet: support ranges with zero padding of mixed lengths (#293) #473
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
That's look great ! I did not review in details yet, waiting for a more final version, however, my 2 first comments are:
|
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.
I'm worried by the compat breakage. I think this is too risky to release 1.9 with this RangeSet behavior change. (str vs int)
NodeSet is also behaving differently, now that the padding is not use the same way, but hopefully everybody will think this was a bug :)
Worth a beta?
) This patch adds support for mixed lengths 0-padding ranges by always using strings instead of integers in the inner set. No need to keep track of padding length per set anymore, as this information is self contained in the strings. Old behavior (single padding length supported): $ cluset -f bar002,bar01,bar0 bar[000-002] New behavior (mixed padding lengths supported): $ cluset -f bar002,bar01,bar0 bar[0,01,002] RangeSet.padding is now available as a property. In case of zero padding with mixed lengths, it returns the maximum padding length. It can also still be used to force a fixed-length padding on the set. Example: >>> r = RangeSet("0,01,002") >>> r 0,01,002 >>> r.padding 3 >>> r.padding = 4 >>> r 0000-0002 >>> r.padding = None >>> r 0-2 Older versions of RangeSet are automatically converted when unpickled. Closes cea-hpc#293 cea-hpc#442
Add check when parsing bogus ranges like 01-010. This is stricter but should avoid mistake and syntax error. Make it handle properly by NodeSet.
This patch adds support for mixed lengths 0-padding ranges by
using sets of strings instead of integers. No need to keep
track of padding length anymore, as this information is self
contained in the strings.
$ cluset -f bar002,bar01
bar[01,002]
Deprecated RangeSet.padding which is now a noop.
Closes #293 #442