Repository navigation
fix(cladistics): load the DOI module and repair the CladeCumulus readers #223
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
Changes from all commits
a3dec9a
1a6a25a
de4e30d
29c30b1
edfd02d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -930,6 +930,45 @@ _saved_root = SV.ServerState._root[] | |
| end | ||
| end | ||
|
|
||
|
|
||
| ## Registration itself | ||
| # A duplicated `include` in server.jl registers every route in that file | ||
| # twice. No request test can see that: the second registration simply | ||
| # shadows the first, and both answer. These checks read the sources, so | ||
| # they fail on the merge that reintroduces a duplicate. | ||
| @testset "Registered routes" begin | ||
| src_dir = joinpath(@__DIR__, "..", "..", "src", "server") | ||
| server_src = read(joinpath(src_dir, "server.jl"), String) | ||
| # Every `include(joinpath(@__DIR__, "a", "b.jl"))` path, in order. | ||
| included = String[] | ||
| for m in eachmatch(r"include\(joinpath\(@__DIR__((?:,\s*\"[^\"]+\")+)\)\)", | ||
| server_src) | ||
| push!(included, join([c[2:end-1] for c in | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When this test processes any matching Useful? React with 👍 / 👎. |
||
| eachmatch(r"\"[^\"]+\"", m.captures[1])], "/")) | ||
| end | ||
| @test !isempty(included) | ||
| # The duplicate that shipped in 8b76b71: routes/cladistics.jl twice. | ||
| # No request test can see this — the second registration shadows the | ||
| # first and both answer — so the invariant is checked on the sources. | ||
| @test allunique(included) | ||
| @test count(==("routes/cladistics.jl"), included) == 1 | ||
| @test count(==("routes/clade_cumulus.jl"), included) == 1 | ||
|
|
||
| # And no route file declares the same method+path twice. | ||
| routes = Tuple{String,String}[] | ||
| for file in sort(readdir(joinpath(src_dir, "routes"); join = true)) | ||
| endswith(file, ".jl") || continue | ||
| for m in eachmatch(r"@(get|post|put|patch|delete)\s+(\"[^\"]+\")", | ||
| read(file, String)) | ||
| push!(routes, (m.captures[1], m.captures[2])) | ||
| end | ||
| end | ||
| @test !isempty(routes) | ||
| @test allunique(routes) | ||
| @test any(r -> occursin("/cladistics", r[2]), routes) | ||
| @test any(r -> occursin("/clade-cumulus", r[2]), routes) | ||
| end | ||
|
|
||
| end | ||
|
|
||
| # Testsets above point the server at temporary roots. | ||
|
|
||
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.
When the newly accepted single-candidate placement has an LWR between 0.5 and 1.0,
twequals that candidate's weight, so this division always produces1.0. The/clade-cumulusdiversity block therefore assigns all of the query's abundance to the reported edge even though the parser explicitly treats the remaining probability mass as unplaced, inflating that tip's contribution to weighted UniFrac and related abundance-based results. Preserve the raw LWR for this one-candidate case, with the remainder accounted for as unplaced, rather than renormalizing it away.Useful? React with 👍 / 👎.