Skip to content

Commit 4dc85db

Browse files
committed
JET test FIX.
1 parent 68d2566 commit 4dc85db

3 files changed

Lines changed: 14 additions & 31 deletions

File tree

src/basis.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,7 @@ function get_nsteps(basis::CompositeBasis)
805805
return get_nsteps(b)
806806
end
807807
end
808+
return 0
808809
end
809810

810811
"""
@@ -818,14 +819,15 @@ function get_dt(basis::WaveguideBasis)
818819
basis.dt
819820
end
820821
function get_dt(basis::Basis)
821-
0
822+
0.0
822823
end
823824
function get_dt(basis::CompositeBasis)
824825
for b in basis.bases
825-
if get_dt(b) != 0
826+
if get_dt(b) != 0.0
826827
return get_dt(b)
827828
end
828829
end
830+
return 0.0
829831
end
830832

831833
"""

src/solver.jl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,6 @@ end
108108
See documentation for [`waveguide_evolution`](@ref) on how to define `fout`. J should be a list of collapse operators following documentation of [`timeevolution.mcwf_dynamic`](https://docs.qojulia.org/api/#QuantumOptics.timeevolution.mcwf_dynamic).
109109
"""
110110
function fast_unitary(times_eval,psi,H;order=2,fout=nothing)
111-
if fout !== nothing
112-
fout_type = QuantumOptics.pure_inference(fout)
113-
output_container = Array{fout_type}(undef,length(times_eval))
114-
end
115111
isapprox(norm(psi),1,rtol=10^(-6)) || @warn "Initial waveguidestate is not normalized. Consider passing norm=true to the state generation function."
116112
dt = get_dt(H.basis_l)
117113
U = generate_unitary(H,dt,order)

test/test_jet.jl

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,10 @@
1-
using WaveguideQED, JET
2-
3-
using JET: ReportPass, BasicPass, InferenceErrorReport, UncaughtExceptionReport
4-
5-
# Custom report pass that ignores `UncaughtExceptionReport`
6-
# Too coarse currently, but it serves to ignore the various
7-
# "may throw" messages for runtime errors we raise on purpose
8-
# (mostly on malformed user input)
9-
struct MayThrowIsOk <: ReportPass end
10-
11-
# ignores `UncaughtExceptionReport` analyzed by `JETAnalyzer`
12-
(::MayThrowIsOk)(::Type{UncaughtExceptionReport}, @nospecialize(_...)) = return
13-
14-
# forward to `BasicPass` for everything else
15-
function (::MayThrowIsOk)(report_type::Type{<:InferenceErrorReport}, @nospecialize(args...))
16-
BasicPass()(report_type, args...)
17-
end
18-
19-
rep = report_package("WaveguideQED";
20-
report_pass=MayThrowIsOk(), # TODO have something more fine grained than a generic "do not care about thrown errors"
21-
ignored_modules=(
22-
))
23-
24-
@show rep
25-
@test_broken length(JET.get_reports(rep)) == 0 # TODO JET reports issues
1+
@testset "JET checks" begin
2+
using JET
3+
using Test
4+
using WaveguideQED
5+
6+
rep = JET.report_package(WaveguideQED, target_defined_modules = true)
7+
println(rep)
8+
@testset length(JET.get_reports(rep)) <= 10
9+
@test_broken length(JET.get_reports(rep)) == 0
10+
end

0 commit comments

Comments
 (0)