-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Make StepRangeLen
in operations which may produce zero step
#40320
Merged
Merged
Changes from 9 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
86a4403
make StepRangeLen more often, to allow zero step
mcabbott 11a9957
remove some === tests
mcabbott 0eb2160
tidy up
mcabbott 33d6e30
new AbstractFloat methods
mcabbott 709031e
rm two methods
mcabbott 4028cfc
solve an ambiguity
mcabbott 2bfe5ec
maybe this will fix it
mcabbott 1019b3a
tests from https://github.com/JuliaLang/julia/issues/40309
mcabbott efd9ba1
one more...
mcabbott c54dc5f
tidy
mcabbott 611cd63
notes + line wrap
mcabbott 15d226b
restrict printing to StepRangeLen
mcabbott 93004fa
add news item
mcabbott f10b89d
Merge remote-tracking branch 'origin/master' into zerostep
simeonschaub File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The last method here handles the case needed for AbstractFFTs tests, above, of float * UnitRange -> range with twiceprecision.
And
(-2:2) * 0.0
works because for floatsrange_start_step_length
does sometimes allow zero step:But probably it could just be
OrdinalRange
. Are there other weird cases we should think about?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 wonder whether
Base.range_start_step_length(1, 0, 5)
should just return aStepRangeLen
. Do you expect that to be too breaking?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 haven't thought about it. Was hoping to change as little as possible, focused on calculations that may produce zero step, rather than constructors.
This one is called by
range(1, step=0, length=10)
which would otherwise make an integer StepRange. Whereasrange(1, 1, length=10)
works, and makes a floating point range. It is a bit weird that some constructors work and some don't, but this isn't changed here.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.
Agree, it's probably better not to change this behavior in this PR. Could you just add a short comment here explaining why we can't use
range_start_step_length
?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.
Sure, see what you think of 56d9c27
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.
Looks good! Let's run PkgEval one more time once tests pass, but otherwise this should be good to go.