Skip to content

Commit ed3adb8

Browse files
committed
Fix floating-point representation in example_line fixture
1 parent 24d9fde commit ed3adb8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/test_xtrack.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ def test_convert_xsuite(example_line: xt.Line, example_tbt: TbtData):
2525
# --- Fixtures ---- #
2626
@pytest.fixture(scope="module")
2727
def example_line():
28-
lcell = 20
29-
f = lcell/np.sin(np.pi/4)/4
28+
lcell = 20.
29+
f = lcell/np.sin(np.pi/4.)/4.
3030
k = 1/f
3131
nturns = 3
32-
qf = xt.Multipole(knl=[0, k], ksl=[0,0])
33-
qd = xt.Multipole(knl=[0,-k], ksl=[0,0])
32+
qf = xt.Multipole(knl=[0., k], ksl=[0.,0.])
33+
qd = xt.Multipole(knl=[0.,-k], ksl=[0.,0.])
3434
drift = xt.Drift(length=10.)
3535
line = xt.Line(
3636
elements=[
@@ -56,5 +56,5 @@ def example_line():
5656
'BPM2'
5757
]
5858
)
59-
line.particle_ref = xt.Particles(p0c=1e9, q0=1, mass0=xt.ELECTRON_MASS_EV)
59+
line.particle_ref = xt.Particles(p0c=1e9, q0=1., mass0=xt.ELECTRON_MASS_EV)
6060
return line

0 commit comments

Comments
 (0)