Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 21-helper-functions-for-best-track-selection
  • DAQSummaryslice
  • better-getters
  • coordstuff
  • daq-io
  • detector-toolkit
  • dst-support
  • dynamic-calibration
  • gh-pages
  • improve-cache
  • improve-show
  • main
  • merged_files_online_offline_matcher
  • multihead-support
  • pmt-rings
  • rbr-iterator
  • read-csk-file
  • v0.1.1
  • v0.11.0
  • v0.12.0
  • v0.12.1
  • v0.12.2
  • v0.12.4
  • v0.12.5
  • v0.12.6
  • v0.12.7
  • v0.13.0
  • v0.13.1
  • v0.14.0
  • v0.14.1
  • v0.14.2
  • v0.14.3
  • v0.14.4
  • v0.14.5
  • v0.14.6
  • v0.14.7
  • v0.14.8
  • v0.16.2
  • v0.16.3
  • v0.16.4
  • v0.16.5
  • v0.16.6
  • v0.16.7
  • v0.16.8
  • v0.16.9
  • v0.17.0
  • v0.17.1
  • v0.17.10
  • v0.17.2
  • v0.17.3
  • v0.17.4
  • v0.17.5
  • v0.17.6
  • v0.17.7
  • v0.17.8
  • v0.17.9
  • v0.18.0
  • v0.18.1
  • v0.18.3
  • v0.18.4
  • v0.18.5
  • v0.18.6
  • v0.2.0
  • v0.2.1
  • v0.2.2
  • v0.3.0
  • v0.3.1
  • v0.4.0
  • v0.4.1
  • v0.5.0
  • v0.6.0
  • v0.7.0
  • v0.8.0
  • v0.9.0
74 results

Target

Select target project
  • common/KM3io.jl
1 result
Select Git revision
  • 21-helper-functions-for-best-track-selection
  • DAQSummaryslice
  • better-getters
  • coordstuff
  • daq-io
  • detector-toolkit
  • dst-support
  • dynamic-calibration
  • gh-pages
  • improve-cache
  • improve-show
  • main
  • merged_files_online_offline_matcher
  • multihead-support
  • pmt-rings
  • rbr-iterator
  • read-csk-file
  • v0.1.1
  • v0.11.0
  • v0.12.0
  • v0.12.1
  • v0.12.2
  • v0.12.4
  • v0.12.5
  • v0.12.6
  • v0.12.7
  • v0.13.0
  • v0.13.1
  • v0.14.0
  • v0.14.1
  • v0.14.2
  • v0.14.3
  • v0.14.4
  • v0.14.5
  • v0.14.6
  • v0.14.7
  • v0.14.8
  • v0.16.2
  • v0.16.3
  • v0.16.4
  • v0.16.5
  • v0.16.6
  • v0.16.7
  • v0.16.8
  • v0.16.9
  • v0.17.0
  • v0.17.1
  • v0.17.10
  • v0.17.2
  • v0.17.3
  • v0.17.4
  • v0.17.5
  • v0.17.6
  • v0.17.7
  • v0.17.8
  • v0.17.9
  • v0.18.0
  • v0.18.1
  • v0.18.3
  • v0.18.4
  • v0.18.5
  • v0.18.6
  • v0.2.0
  • v0.2.1
  • v0.2.2
  • v0.3.0
  • v0.3.1
  • v0.4.0
  • v0.4.1
  • v0.5.0
  • v0.6.0
  • v0.7.0
  • v0.8.0
  • v0.9.0
74 results
Show changes
Commits on Source (10)
......@@ -26,6 +26,8 @@ before_script:
Pkg.Registry.add(RegistrySpec(url = "https://git.km3net.de/common/julia-registry"))'
julia --project=@. -e '
using Pkg
Pkg.instantiate()
Pkg.resolve()
Pkg.build()
Pkg.test(coverage=true)'
......@@ -79,6 +81,7 @@ docs:
Pkg.update()
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()
Pkg.resolve()
using Documenter: doctest
using KM3io
doctest(KM3io)
......
......@@ -9,6 +9,7 @@ DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
Sockets = "6462fe0b-24de-5631-8697-dd941f90decc"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
......@@ -16,17 +17,25 @@ TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
UnROOT = "3cd96dde-e98d-4713-81e9-a4a1b0235ce9"
[weakdeps]
KM3DB = "a9013879-bb44-4449-9e5b-40f9ac008ab0"
[extensions]
KM3ioKM3DBExt = "KM3DB"
[compat]
DocStringExtensions = "0.8, 0.9"
HDF5 = "^0.16.15, ^0.17"
KM3DB = "0.2.2"
KM3NeTTestData = "^0.4.14"
StaticArrays = "1"
UnROOT = "^0.10.26"
julia = "1"
[extras]
KM3DB = "a9013879-bb44-4449-9e5b-40f9ac008ab0"
KM3NeTTestData = "3249b543-581e-4f22-b7da-6c2cdf549b24"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
[targets]
test = ["Test", "KM3NeTTestData"]
test = ["Test", "KM3NeTTestData", "KM3DB"]
......@@ -3,6 +3,7 @@ CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
FHist = "68837c9b-b678-4cd5-9925-8a54edc8f695"
HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
KM3DB = "a9013879-bb44-4449-9e5b-40f9ac008ab0"
KM3NeTTestData = "3249b543-581e-4f22-b7da-6c2cdf549b24"
KM3io = "2cab5852-6f21-4982-99b0-6a4792870cfb"
LiveServer = "16fef848-5104-11e9-1b77-fb7a48bbb589"
......
......@@ -34,6 +34,22 @@ det = Detector(datapath("detx", "detx_v5.detx"))
A detector configuration (format version 5) has been loaded with 6 strings
(sometimes also called detection unit or DU) holding a total 114 modules.
## Retrieve a detector from the DB
`KM3io.jl` comes with a `KM3DB.jl` extension which allows to load detector
information directly from the database. The extension is automatically loaded
when `KM3DB` is imported:
```@example KM3DB
using KM3io
using KM3DB
det = Detector(133)
```
Keyword arguments passed as `Detector(det_id; kwarg1=..., kwarg2=..., ...)` are
handed over to the `detx()` function in `KM3DB.jl`.
## Accessing Modules
### Iterating over all modules
......
module KM3ioKM3DBExt
import KM3io: Detector, read_detx
if isdefined(Base, :get_extension)
import KM3DB: detx
else
import ..KM3DB: detx
end
"""
Instantiate a detector by polling the database for a given detector ID.
The keyword arguments `kwargs` are passed to the `detx()` function in `KM3DB.jl`.
"""
function Detector(det_id::Integer; kwargs...)
raw = detx(det_id; kwargs...)
read_detx(IOBuffer(raw))
end
end
......@@ -9,6 +9,10 @@ using Sockets
using UUIDs
using TOML
if !isdefined(Base, :get_extension)
using Requires
end
const version = let
if VERSION < v"1.9"
VersionNumber(TOML.parsefile(joinpath(pkgdir(KM3io), "Project.toml"))["version"])
......@@ -75,4 +79,11 @@ include("tools/helpers.jl")
include("physics.jl")
function __init__()
@static if !isdefined(Base, :get_extension)
@require KM3DB="a9013879-bb44-4449-9e5b-40f9ac008ab0" include("../ext/KM3ioKM3DBExt.jl")
end
end
end # module
......@@ -211,3 +211,9 @@ end
@test isapprox([83.4620946059086, 312.254188175614, 377.8839470243232], center(d); atol=0.01)
end
end
@testset "KM3DB extensions" begin
using KM3DB
d = Detector(133)
@test 399 == length(d)
end