-
Notifications
You must be signed in to change notification settings - Fork 8
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
Revise layer number in force_layer #20
Conversation
@oxinabox This is a simple fix, if you prefer the 0-based layer, simply close this PR. |
Codecov Report
@@ Coverage Diff @@
## main #20 +/- ##
=======================================
Coverage 92.39% 92.39%
=======================================
Files 4 4
Lines 184 184
=======================================
Hits 170 170
Misses 14 14
Continue to review full report at Codecov.
|
@oxinabox Any comment on this pull request? Sorry for bothering |
Oh sorry. What do you think if we replaced: LayeredLayouts.jl/src/layering.jl Line 4 in c992a7e
with layer_inds = longest_paths(graph, sources(graph)) .+ 1 and then make corresponding renames through out. Since a We might also need a |
@oxinabox no problem. The fact is that -1 applies only to the layers that are forced by the user and there is not an easy way to do .-1 only to the second term of a pair, without heavy notation that I think is not needed. The possible solutions I see are:
What do you think? |
But we wouldn't need to subtract 1 if we used |
The problem I stated arises only for the force_layers specified by the user. |
But dists would also be fine if it was 1 larger and called |
Absolutely agree; the algorithm works in relative terms: we could change dists to be 1-base (currently is 0-based) or keep dists to be 0-based and adapt the layer_inds to match the expected behaviour by the user to specify the layer in terms of 1,2,... also according to Julia convention (vectors are 1-based) and the examples and tests used in which the layers are numbered from 1 to N. Since dists is only an internal variable, changing all the code to adapt an internal variable I think is not worthy. |
@oxinabox Any updates on this PR? It would be nice to finalize it so that this PR (daschw/SankeyPlots.jl#22) can be finalized as well. |
Sorry I have been away for work and then I got covid. And the answer is because |
@oxinabox I think I found a good way to make dists 1-based. Luckily the absolute value of dists is not used in the algorithm, hence the change was easier than expected. |
@oxinabox Sorry for the pressing, but could be possible to finalize this and the parallel PR soon? I'd like to close these current open chapters and the several PRs pending this in other packages, possibly. |
@oxinabox Please, could you please close also this PR? it is a simple +1 to change the ordering... Moreover, after that, if you could launch the registrator would be perfect |
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.
LGTM.
Thanks.
This seems the ideal solution.
Sorry about the extreme time it has taken between reviews.
I get like a dozen notifications i have to attend to each day, for better or worse mostly higher priority than this.
and I have a day job.
No problem, thank you very much! |
In the previous pull request, to force node 5 in layer 3, it was needed to set [5=>2], which is a bit ackward as the entire Julia is 1-based.
In this request we fix that, so to specify node 5 in layer 3, the code [5=>3] shall be provided