Skip to content

Commit 09d7e0a

Browse files
authored
Merge pull request #109 from xsuite/release/v0.5.5
Release 0.5.5
2 parents a237888 + f438847 commit 09d7e0a

20 files changed

+153
-178
lines changed

examples/everest_collimator.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848

4949
# Assign the optics to deduce the gap settings
50-
xc.assign_optics_to_collimators(line=line)
50+
line.collimators.assign_optics()
5151

5252

5353
# --------------------------------------------------------
@@ -71,9 +71,9 @@
7171

7272
# Track
7373
print("Tracking first test.. ")
74-
xc.enable_scattering(line)
74+
line.scattering.enable()
7575
line.track(part, num_turns=1)
76-
xc.disable_scattering(line)
76+
line.scattering.disable()
7777

7878
# Sort the particles by their ID
7979
part.sort(interleave_lost_particles=True)
@@ -100,7 +100,7 @@
100100
# oscillations would make the cut profile symmetric anyway.
101101

102102
line['tcp.c6l7.b1'].angle = 15
103-
xc.open_collimators(line)
103+
line.collimators.open()
104104
line['tcp.c6l7.b1'].gap = [4, -7]
105105

106106
# Create initial particles
@@ -111,9 +111,9 @@
111111

112112
# Track
113113
print("Tracking second test.. ")
114-
xc.enable_scattering(line)
114+
line.scattering.enable()
115115
line.track(part, num_turns=1)
116-
xc.disable_scattering(line)
116+
line.scattering.disable()
117117

118118
# Sort the particles by their ID
119119
part.sort(interleave_lost_particles=True)

examples/impact_table.py

Lines changed: 0 additions & 71 deletions
This file was deleted.

examples/impacts.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
# ============================================
1313

1414
# Get line and collimators
15-
line = xt.Line.from_json(xc._pkg_root / '..' / 'examples' / 'machines' / 'lhc_run3_b1.json')
15+
line = xt.Line.from_json(xc._pkg_root.parent / 'examples' / 'machines' / 'lhc_run3_b1.json')
1616

17-
coll_manager = xc.CollimatorDatabase.from_yaml(xc._pkg_root / '..' / 'examples' / 'colldb' / 'lhc_run3.yaml', beam=1)
18-
coll_manager.install_everest_collimators(verbose=True, line=line)
17+
colldb = xc.CollimatorDatabase.from_yaml(xc._pkg_root.parent / 'examples' / 'colldb' / 'lhc_run3.yaml', beam=1)
18+
colldb.install_everest_collimators(verbose=True, line=line)
1919
df_with_coll = line.check_aperture()
2020
assert not np.any(df_with_coll.has_aperture_problem)
2121

@@ -24,22 +24,22 @@
2424

2525
# Build tracker, assign optics and generate particles
2626
line.build_tracker()
27-
xc.assign_optics_to_collimators(line=line)
27+
line.collimators.assign_optics()
2828
part = xc.generate_pencil_on_collimator(line, 'tcp.d6l7.b1', 50000)
2929

3030
# This is not needed, but is done here so that we can track with 12 treads.
3131
line.discard_tracker()
3232
line.build_tracker(_context=xo.ContextCpu(omp_num_threads=12))
3333

3434
# Track
35-
xc.enable_scattering(line)
35+
line.scattering.enable()
3636
line.track(part, num_turns=20, time=True, with_progress=1)
37-
xc.disable_scattering(line)
37+
line.scattering.disable()
3838
line.discard_tracker()
3939
impacts.stop()
4040

4141
df = impacts.to_pandas()
42-
df.to_csv('impacts.csv', index=False)
42+
df.to_csv('impacts_line.csv', index=False)
4343

4444
# ============================================
4545
# With collimator
@@ -59,7 +59,7 @@
5959
part.sort(interleave_lost_particles=True)
6060

6161
df = impacts_coll.to_pandas()
62-
df[df.interaction_type == 'Enter Jaw L'].to_csv('Enter_Jaw_L.csv', index=False)
62+
df[df.interaction_type == 'Enter Jaw L'].to_csv('impacts_coll_enter_jaw_L.csv', index=False)
6363

6464
# ============================================
6565
# With crystal
@@ -80,4 +80,4 @@
8080

8181
impacts_crystal.to_pandas()
8282
df_crystal = impacts_crystal.interactions_per_collimator()
83-
df_crystal.to_csv('interactions_per_crystal.csv', index=False)
83+
df_crystal.to_csv('impacts_crystal_interactions.csv', index=False)

examples/lhc_run3_lossmap.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151

5252

5353
# Assign the optics to deduce the gap settings
54-
xc.assign_optics_to_collimators(line=line)
54+
line.collimators.assign_optics()
5555

5656

5757
# Optimise the line
@@ -70,9 +70,9 @@
7070

7171

7272
# Track!
73-
xc.enable_scattering(line)
73+
line.scattering.enable()
7474
line.track(part, num_turns=num_turns, time=True, with_progress=1)
75-
xc.disable_scattering(line)
75+
line.scattering.disable()
7676
print(f"Done tracking in {line.time_last_track:.1f}s.")
7777

7878

examples/lhc_run3_lossmap_with_blowup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767

6868
# Assign the optics to deduce the gap settings, and calibrate the ADT
6969
tw = line.twiss()
70-
xc.assign_optics_to_collimators(line=line, twiss=tw)
70+
line.collimators.assign_optics(twiss=tw)
7171
if plane == 'H':
7272
adt.calibrate_by_emittance(nemitt=nemitt_x, twiss=tw)
7373
else:
@@ -90,11 +90,11 @@
9090

9191

9292
# Track!
93-
xc.enable_scattering(line)
93+
line.scattering.enable()
9494
adt.activate()
9595
line.track(part, num_turns=num_turns, time=True, with_progress=1)
9696
adt.deactivate()
97-
xc.disable_scattering(line)
97+
line.scattering.disable()
9898
print(f"Done tracking in {line.time_last_track:.1f}s.")
9999

100100

examples/lhc_run3_lossmap_with_crystals.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858

5959

6060
# Assign the optics to deduce the gap settings
61-
xc.assign_optics_to_collimators(line=line)
61+
line.collimators.assign_optics()
6262

6363
# Apply settings
6464
line[tcpc].bending_angle = 40.e-6
@@ -91,9 +91,9 @@
9191

9292

9393
# Track!
94-
xc.enable_scattering(line)
94+
line.scattering.enable()
9595
line.track(part, num_turns=num_turns, time=True, with_progress=1)
96-
xc.disable_scattering(line)
96+
line.scattering.disable()
9797
print(f"Done tracking in {line.time_last_track:.1f}s.")
9898

9999

examples/lhc_run3_offmomentum_lossmap.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656

5757

5858
# Assign the optics to deduce the gap settings
59-
xc.assign_optics_to_collimators(line=line)
59+
line.collimators.assign_optics()
6060

6161

6262
# Optimise the line
@@ -81,9 +81,9 @@
8181

8282

8383
# Track during RF sweep:
84-
xc.enable_scattering(line)
84+
line.scattering.enable()
8585
rf_sweep.track(sweep=sweep, particles=part, num_turns=num_turns, time=True, with_progress=5)
86-
xc.disable_scattering(line)
86+
line.scattering.disable()
8787
print(f"Done sweeping RF in {line.time_last_track:.1f}s.")
8888

8989

examples/transfer_line_with_air.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
line.build_tracker()
6565

6666
# Scattering need to be disabled to be able to twiss
67-
xc.disable_scattering(line)
67+
line.scattering.disable()
6868

6969
# Matched initial parameters
7070
betx0 = 154.0835045206266
@@ -90,7 +90,7 @@
9090

9191
# Track!
9292
# ======
93-
xc.enable_scattering(line)
93+
line.scattering.enable()
9494
line.track(part)
9595
print("Done Tracking!")
9696

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "xcoll"
3-
version = "0.5.4"
3+
version = "0.5.5"
44
description = "Xsuite collimation package"
55
homepage = "https://github.com/xsuite/xcoll"
66
repository = "https://github.com/xsuite/xcoll"
File renamed without changes.

0 commit comments

Comments
 (0)