Skip to content

Commit fa9ea25

Browse files
committed
delete ucovert
1 parent 5b355bd commit fa9ea25

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

test/test_charge_drift_models.jl

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -570,43 +570,44 @@ end
570570

571571
cartesian_unit = CartesianPoint(0.01u"m", 0.0u"m", 0.05u"m")
572572
cartesian_float = CartesianPoint(0.01, 0.0, 0.05)
573-
cylindrical_unit = CylindricalPoint(0.01u"m", π/4u"rad", 0.05u"m")
573+
#cylindrical_unit = CylindricalPoint(0.01u"m", π/4u"rad", 0.05u"m")
574+
cylindrical_unit = CylindricalPoint(0.01, π/4, 0.05)
574575
cylindrical_float = CylindricalPoint(0.01, π/4, 0.05)
575576
Edep = 1u"MeV"
576577

577578
# Variant 1: CartesianPoint with Units, energy
578579
nb1 = NBodyChargeCloud(cartesian_unit, Edep)
579580
@test all(x -> x isa CartesianPoint, nb1.locations)
580-
@test isapprox(sum(nb1.energies), ustrip.(uconvert.(u"eV", Edep)))
581+
@test isapprox(sum(nb1.energies), ustrip.(u"eV", Edep))
581582

582583
# Variant 2: CylindricalPoint with Units, energy
583584
nb2 = NBodyChargeCloud(cylindrical_unit, Edep)
584585
@test all(x -> x isa CartesianPoint, nb2.locations)
585-
@test isapprox(sum(nb2.energies), ustrip.(uconvert.(u"eV", Edep)))
586+
@test isapprox(sum(nb2.energies), ustrip.(u"eV", Edep))
586587

587588
# Variant 3: CartesianPoint with Units, energy, N
588589
nb3 = NBodyChargeCloud(cartesian_unit, Edep, 10, radius = 0.001, number_of_shells = 1)
589590
@test all(x -> x isa CartesianPoint, nb3.locations)
590591
@test length(nb3.locations) >= 10
591-
@test isapprox(sum(nb3.energies), ustrip.(uconvert.(u"eV", Edep)))
592+
@test isapprox(sum(nb3.energies), ustrip.(u"eV", Edep))
592593

593594
# Variant 4: CylindricalPoint with Units, energy, N
594595
nb4 = NBodyChargeCloud(cylindrical_unit, Edep, 10, radius = 0.001, number_of_shells = 1)
595596
@test all(x -> x isa CartesianPoint, nb4.locations)
596597
@test length(nb4.locations) >= 10
597-
@test isapprox(sum(nb4.energies), ustrip.(uconvert.(u"eV", Edep)))
598+
@test isapprox(sum(nb4.energies), ustrip.(u"eV", Edep))
598599

599600
# Edge case, zero radius
600601
nb_zero = NBodyChargeCloud(cartesian_float, Edep, 5, radius = 0.0, number_of_shells = 1)
601602
@test all(x -> x isa CartesianPoint, nb_zero.locations)
602603
@test all(x -> x == nb_zero.locations[1], nb_zero.locations) # all points coincide at the center
603-
@test isapprox(sum(nb_zero.energies), ustrip.(uconvert.(u"eV", Edep)))
604+
@test isapprox(sum(nb_zero.energies), ustrip.(u"eV", Edep))
604605
@test all(x -> all(isfinite, (x.x, x.y, x.z)), nb_zero.locations)
605606

606607
nb_zero_cyl = NBodyChargeCloud(cylindrical_float, Edep, 5, radius = 0.0, number_of_shells = 1)
607608
@test all(x -> x isa CartesianPoint, nb_zero_cyl.locations)
608609
@test all(x -> x == nb_zero_cyl.locations[1], nb_zero_cyl.locations)
609-
@test isapprox(sum(nb_zero_cyl.energies), ustrip.(uconvert.(u"eV", Edep)))
610+
@test isapprox(sum(nb_zero_cyl.energies), ustrip.(u"eV", Edep))
610611
@test all(x -> all(isfinite, (x.x, x.y, x.z)), nb_zero_cyl.locations)
611612

612613
end

0 commit comments

Comments
 (0)