Skip to content
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

Fixes for 0.7 #10

Merged
merged 1 commit into from
Sep 10, 2018
Merged

Fixes for 0.7 #10

merged 1 commit into from
Sep 10, 2018

Conversation

rsrock
Copy link
Contributor

@rsrock rsrock commented Aug 14, 2018

No description provided.

@rsrock rsrock mentioned this pull request Aug 29, 2018
Copy link
Member

@bjarthur bjarthur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great! next time maybe ping me or @tlnagy if you don't get a timely response. what do you use hexagons.jl for? i guess i'll chock up my work on #11 to an exercise in learning the new iterate protocol!

@@ -3,8 +3,7 @@ os:
- linux
- osx
julia:
- 0.4
- 0.5
- 0.7
- nightly
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the only real difference with #11 is that i allowed failures on nightly to make hexagons like gadfly and compose.

@@ -1,2 +1,2 @@
julia 0.4
julia 0.7
Compat 0.17
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are their any remaining calls to @compat ? if not can we remove this requirement?


function next(it::HexagonNeighborIterator, state::Int)
function Base.iterate(it::HexagonNeighborIterator, state=1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here and elsewhere, must one qualify iterate with Base. ?

new((@compat Float64(x)), (@compat Float64(y)),
(@compat Float64(xsize)), (@compat Float64(ysize)))
new((Float64(x)), (Float64(y)),
(Float64(xsize)), (Float64(ysize)))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here and elsewhere, there are extra parens that could be removed


# The state of a HexagonSpiralIterator consists of
# 1. an Int, the index of the current ring
# 2. a HexagonRingIterator and its state to keep track of the current position
# in the ring.
function next(it::HexagonSpiralIterator, state::HexagonSpiralIteratorState)
function Base.iterate(it::HexagonSpiralIterator,
state::HexagonSpiralIteratorState=_start(it))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are their pros and cons to calling _start in the function signature, versus creating a second iterate method with a single input argument as i did in #11 ? the latter is easier to read to me, but i'm not familiar enough with julia internals to know if there's a performance difference.

@rsrock
Copy link
Contributor Author

rsrock commented Sep 3, 2018

No worries @bjarthur! I don't use Hexagons for anything other than Gadfly. Also a good chance to learn the new iteration protocol myself 😄.

I will go over your comments in the next few days

@bjarthur
Copy link
Member

bjarthur commented Sep 5, 2018

great! we're hoping to release a beta gadfly for field testing in the next few days too. this PR is critical to that plan.

@tlnagy
Copy link
Member

tlnagy commented Sep 8, 2018

Now that the monster Compose PR is merged (GiovineItalia/Compose.jl#282). This PR is high priority for getting Gadfly working. @rsrock do you have any time to look at this in the next couple of days?

@bjarthur might be worth re-opening your PR if we don't hear back from Ron. I'm fine with either iteration implementation.

@bjarthur bjarthur merged commit 6498ab9 into GiovineItalia:master Sep 10, 2018
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.

3 participants