-
Notifications
You must be signed in to change notification settings - Fork 6
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
Implementation of substructure modules #87
base: main
Are you sure you want to change the base?
Conversation
Added some of the jet taggers and groomers (Mass Drop, Soft Drop, Jet Trim, Jet Filter). Yet to add the JH Top Tagger. Need to add documentation to the code.
Added suitable documentation to Substructure.jl Will add more to jetreco-substructure.jl
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #87 +/- ##
==========================================
+ Coverage 71.52% 73.49% +1.97%
==========================================
Files 17 18 +1
Lines 1166 1249 +83
==========================================
+ Hits 834 918 +84
+ Misses 332 331 -1 ☔ View full report in Codecov by Sentry. |
Thank you for this @sattwamo. A few things jump out right away: FormattingYou need to format the code according to our formatting guidelines. It's not hard to do this: ~/.julia/dev/JetReconstruction/ [substructure] julia
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.11.1 (2024-10-16)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia> using JuliaFormatter
julia> format(".")
false
julia> format(".")
true The TestsWe need some tests for the new code. Roughly this is to use FastJet to generate a reference output. For the reconstruction it is convenient to store this as gzipped JSON files (see The new way to do tests is to have them factorised, e.g., add a You can look at This allows one to run tests for one component, but still use the same tests in the everything running together in the CI. ExamplesThe new way I like to do examples is to factorise them by functionality. So create an See https://github.com/JuliaHEP/JetReconstruction.jl/tree/main/examples/EDM4hep as the working example for how I want to do this (the current examples need to be factorised). DocumentationTagging and filtering need to be documented. I would suggest doing this in its own documentation section, e.g., Previewing the documentation is as usual in Documenter.jl, viz. ~/.julia/dev/JetReconstruction/docs/ [substructure*] julia --project
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.11.1 (2024-10-16)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia> include("make.jl")
[ Info: SetupBuildDirectory: setting up build directory.
[ Info: Doctest: running doctests.
[ Info: ExpandTemplates: expanding markdown templates.
[ Info: CrossReferences: building cross-references.
[ Info: CheckDocument: running document checks.
[ Info: Populate: populating indices.
[ Info: RenderDocument: rendering document.
[ Info: HTMLWriter: rendering HTML pages.
┌ Warning: Generated HTML over size_threshold_warn limit: lib/internal.md
│ Generated file size: 128.16 (KiB)
│ size_threshold_warn: 100.0 (KiB)
│ size_threshold: 200.0 (KiB)
│ HTML file: lib/internal/index.html
└ @ Documenter.HTMLWriter ~/.julia/packages/Documenter/C1XEF/src/html/HTMLWriter.jl:1828
[ Info: Automatic `version="0.4.3"` for inventory from ../Project.toml
┌ Warning: Documenter could not auto-detect the building environment. Skipping deployment.
└ @ Documenter ~/.julia/packages/Documenter/C1XEF/src/deployconfig.jl:76
julia> using LiveServer
julia> LiveServer.serve(dir="build/")
✓ LiveServer listening on http://localhost:8000/ ...
(use CTRL+C to shut down) I will leave any specific code comments separately. |
what's the status of making this inline comments of PR |
On the TODO list! |
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.
Great - thank you @sattwamo. This looks pretty solid.
I have left a bunch of comments, which are mostly about coding style and being consistent with the conventions in the rest of the module.
Added documentation, tests and formatted the code appropriately.
Hello @sattwamo! Sorry it took some time to get back to this as I was travelling. Overall things are looking in rather good shape now! More detailed comments to come, but a few quick things: TestsInput filesCan you ~/code/juliadev/JetReconstruction/test/data/ [substructure] ls -l fastjet*
-rw-r--r-- 1 graemes staff 196740 Nov 20 15:24 fastjet-jet-filter.json
-rw-r--r-- 1 graemes staff 184888 Nov 20 15:24 fastjet-jet-trim.json
-rw-r--r-- 1 graemes staff 189687 Nov 20 15:24 fastjet-mass-drop.json
-rw-r--r-- 1 graemes staff 158266 Nov 20 15:24 fastjet-soft-drop.json
~/code/juliadev/JetReconstruction/test/data/ [substructure] gzip -9 fastjet*
~/code/juliadev/JetReconstruction/test/data/ [substructure*] ls -l fastjet*
-rw-r--r-- 1 graemes staff 39751 Nov 20 15:24 fastjet-jet-filter.json.gz
-rw-r--r-- 1 graemes staff 30918 Nov 20 15:24 fastjet-jet-trim.json.gz
-rw-r--r-- 1 graemes staff 34650 Nov 20 15:24 fastjet-mass-drop.json.gz
-rw-r--r-- 1 graemes staff 17865 Nov 20 15:24 fastjet-soft-drop.json.gz The DocumentationStructuresYou don't need, in fact you shouldn't, document the structures in You reference it like this:
(there are a lot of examples in What goes in |
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.
Only small changes needed now. Looking good!
Added new documentation on using substructure modules. Minor changes.
Great @sattwamo - all looks good to me bar a small improvement in the docstrings. Can you make sure that in the docstring for functions and structs the arguments or fields are:
I pointed out a few of these cases, but not all, in code comments. |
examples/Substructure/JetGrooming.jl
Outdated
@@ -0,0 +1,39 @@ | |||
#! /usr/bin/env julia |
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.
One small additional point - favour lowercase for directory names here, so make the directory substructure
.
Yes, EDM4hep
breaks this rule, but it's because EDM = Event Data Model, so it's a acronym; plus it's the actual name of the package.
To finesse this, if the function signature is short and the variable names are clear then it's not necessary to list them separately in the docstring (thanks to @grasph for pointing out this out: https://docs.julialang.org/en/v1/manual/documentation/#Writing-Documentation). Do make sure that type specifiers are present! |
formatted some doctrings and formatted the documentation.
Almost perfect - we just need to rename the examples directory as This can be a bit tricky if you are using git on a case insensitive filesystem (which is the default on OS X), but it can be managed - it's better still to fix this on this branch, because it can cause some issues for OS X if case changes between different commits in the same repository. Let me know if you want some help to do this bit. |
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.
Only needs the examples directory name to be made lowercase
Also, once this PR is accepted I would like to make a new release with these new features |
Added functions for mass drop, soft drop, jet filtering and jet trimming in
src/Substructure.jl
Added examples of using mass drop and jet trimming in
examples/jetreco-substructure.jl