Skip to content

Commit

Permalink
Merge pull request #119 from xsuite/release/v0.5.10
Browse files Browse the repository at this point in the history
Release 0.5.10
  • Loading branch information
freddieknets authored Nov 8, 2024
2 parents b88c6b0 + 3d6ebe1 commit afe4c9d
Show file tree
Hide file tree
Showing 20 changed files with 260 additions and 260 deletions.
4 changes: 2 additions & 2 deletions make_release_branch.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# Copyright (c) CERN, 2024. #
# ######################################### #

from xaux.tools import dev_make_release_branch
from xaux.dev_tools import make_release_branch
# sys.tracebacklimit = 0


dev_make_release_branch("xcoll")
make_release_branch("xcoll")
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "xcoll"
version = "0.5.9"
version = "0.5.10"
description = "Xsuite collimation package"
homepage = "https://github.com/xsuite/xcoll"
repository = "https://github.com/xsuite/xcoll"
Expand All @@ -26,7 +26,7 @@ ruamel-yaml = { version = "^0.17.31", optional = true }
numpy = ">=1.0"
pandas = ">=1.4"
xobjects = ">=0.4.5"
xdeps = ">=0.7.3"
xdeps = ">=0.7.4"
xpart = ">=0.19.1"
xtrack = ">=0.69.7"

Expand Down
4 changes: 2 additions & 2 deletions release.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# Copyright (c) CERN, 2024. #
# ######################################### #

from xaux.tools import dev_release
from xaux.dev_tools import make_release
# sys.tracebacklimit = 0


dev_release("xcoll")
make_release("xcoll")
4 changes: 2 additions & 2 deletions rename_release_branch.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# Copyright (c) CERN, 2024. #
# ######################################### #

from xaux.tools import dev_rename_release_branch
from xaux.dev_tools import rename_release_branch
# sys.tracebacklimit = 0


dev_rename_release_branch("xcoll")
rename_release_branch("xcoll")
2 changes: 0 additions & 2 deletions tests/data/all_tests.list
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ tests/test_colldb.py::test_loading_no_merge
tests/test_colldb.py::test_loading_crystals
tests/test_colldb.py::test_loading_SixTrack
tests/test_colldb.py::test_loading_SixTrack_crystals
tests/test_colldb.py::test_dumping
tests/test_colldb.py::test_dumping_from_Sixtrack
tests/test_elements.py::test_black_absorber[ContextCpu]
tests/test_elements.py::test_black_absorber[ContextCpu:auto]
tests/test_elements.py::test_black_crystal[ContextCpu]
Expand Down
2 changes: 1 addition & 1 deletion tests/data/assert_listing.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ def pytest_collection_modifyitems(self, session, config, items):
sys.exit("Please run data/store_all_tests.py as there are some new "
+ "tests that are not logged yet:\n" + '\n'.join(only_current))
if len(only_expected) > 0:
sys.exit("The following tests were expected but not found:\n" + '\n'.join(only_expected))
sys.exit("The following tests were expected but not found:\n" + '\n'.join(only_expected) + "Please run data/store_all_tests.py")
2 changes: 1 addition & 1 deletion tests/data/colldb_lhc_run3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ collimators:
tcdqa.b4r6.b1: { <<: *TCDQ }
tcsp.a4r6.b1: { <<: *TCSP }
tcp.d6l7.b1: { <<: *TCP7, angle: 90, material: MoGR }
tcp.c6l7.b1: { <<: *TCP7, angle: 0, material: MoGR }
tcp.c6l7.b1: { <<: *TCP7, angle: 0, material: MoGR, tilt: [-250e-6, 250e-6] }
tcp.b6l7.b1: { <<: *TCP7, angle: 127.5 }
tcsg.a6l7.b1: { <<: *TCSG7, angle: 141.1 }
tcpcv.a6l7.b1: { <<: *CRY7, angle: 90, bending_radius: 85.10, width: 5.0e-3, height: 30.0e-3 }
Expand Down
3 changes: 2 additions & 1 deletion tests/data/colldb_lhc_run3_b1.json
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,8 @@
"tcp.c6l7.b1": {
"family": "TCP7",
"angle": 0,
"material": "MoGR"
"material": "MoGR",
"tilt": [-250e-6, 250e-6]
},
"tcp.b6l7.b1": {
"family": "TCP7",
Expand Down
2 changes: 1 addition & 1 deletion tests/data/colldb_lhc_run3_b1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Collimators:
tcdqa.b4r6.b1: { <<: *TCDQ }
tcsp.a4r6.b1: { <<: *TCSP }
tcp.d6l7.b1: { <<: *TCP7, angle: 90, material: MoGR }
tcp.c6l7.b1: { <<: *TCP7, angle: 0, material: MoGR }
tcp.c6l7.b1: { <<: *TCP7, angle: 0, material: MoGR, tilt: [-250e-6, 250e-6] }
tcp.b6l7.b1: { <<: *TCP7, angle: 127.5 }
tcsg.a6l7.b1: { <<: *TCSG7, angle: 141.1 }
tcpcv.a6l7.b1: { <<: *CRY7, angle: 90, bending_radius: 85.10, width: 5.0e-3, height: 30.0e-3 }
Expand Down
2 changes: 1 addition & 1 deletion tests/data/colldb_lhc_run3_b1_no_families.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ tcdqa.c4r6.b1: { gap: 7.3, stage: tertiary, material: C, length: 3, a
tcdqa.b4r6.b1: { gap: 7.3, stage: tertiary, material: C, length: 3, angle: 0, parking: 0.025, side: left }
tcsp.a4r6.b1: { gap: 7.3, stage: SECONDARY, material: C, Length: 1, angle: 0, parking: 0.025 }
TCP.D6l7.B1: { gap: 5, stage: primary, material: MoGR, length: 0.6, angle: 90, parking: 0.025 }
tcp.c6l7.b1: { gap: 5, stage: primary, MATeRIAL: MoGR, length: 0.6, angle: 0, parking: 0.025 }
tcp.c6l7.b1: { gap: 5, stage: primary, MATeRIAL: MoGR, length: 0.6, angle: 0, parking: 0.025, tilt: [-250e-6, 250e-6] }
tcp.b6l7.b1: { gap: 5, stage: primary, material: C, length: 0.6, angle: 127.5, parking: 0.025 }
tcsg.a6l7.b1: { gap: 6.5, stage: secondary, material: C, length: 1, angle: 141.1, parking: 0.025 }
tcpcv.a6l7.b1: { gap: null, stage: special, material: Si, length: 0.004, angle: 90, parking: 0.025, side: left, crystal: strip, Bending_radius: 85.10, Width: 5.0e-3, height: 30.0e-3 }
Expand Down
2 changes: 1 addition & 1 deletion tests/data/colldb_lhc_run3_b1_no_merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Collimators:
tcdqa.b4r6.b1: { family: TCDQ }
tcsp.a4r6.b1: { family: TCSP }
tcp.d6l7.b1: { family: TCP7, angle: 90, material: MoGR }
tcp.c6l7.b1: { family: TCP7, angle: 0, material: MoGR }
tcp.c6l7.b1: { family: TCP7, angle: 0, material: MoGR, tilt: [-250e-6, 250e-6] }
tcp.b6l7.b1: { family: TCP7, angle: 127.5 }
tcsg.a6l7.b1: { family: TCSG7, angle: 141.1 }
tcpcv.a6l7.b1: { family: CRY7, angle: 90, bending_radius: 85.10, width: 5.0e-3, height: 30.0e-3 }
Expand Down
4 changes: 2 additions & 2 deletions tests/data/colldb_lhc_run3_ir7.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ emittance:
collimators:
b1:
tcp.d6l7.b1: { <<: *TCP7, angle: 90, material: MoGR, length: 1.565 }
tcp.c6l7.b1: { <<: *TCP7, angle: 0, material: MoGR }
tcp.c6l7.b1: { <<: *TCP7, angle: 0, material: MoGR, tilt: [-250e-6, 250e-6] }
tcp.b6l7.b1: { <<: *TCP7, angle: 127.5 }
tcsg.a6l7.b1: { <<: *TCSG7, angle: 141.1 }
tcpcv.a6l7.b1: { <<: *CRY7, angle: 90, bending_radius: 85.10, width: 5.0e-3, height: 30.0e-3 }
Expand All @@ -29,7 +29,7 @@ collimators:

b2:
tcp.d6r7.b2: { <<: *TCP7, angle: 90, material: MoGR, length: 1.565 }
tcp.c6r7.b2: { <<: *TCP7, angle: 0, material: MoGR }
tcp.c6r7.b2: { <<: *TCP7, angle: 0, material: MoGR, tilt: [-250e-6, 250e-6] }
tcp.b6r7.b2: { <<: *TCP7, angle: 127.5 }
tcsg.a6r7.b2: { <<: *TCSG7, angle: 141.1 }
tcpcv.a6r7.b2: { <<: *CRY7, angle: 90, bending_radius: 74.88, width: 5.0e-3, height: 30.0e-3 }
Expand Down
98 changes: 49 additions & 49 deletions tests/test_colldb.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ def test_loading_SixTrack():
colldb_2 = xc.CollimatorDatabase.from_SixTrack(path / 'colldb_lhc_run3_b1.dat', nemitt_x=3.5e-6, nemitt_y=3.5e-6)
df1 = colldb_1.to_pandas().reindex(sorted(colldb_1.to_pandas().columns), axis=1)
df2 = colldb_2.to_pandas().reindex(sorted(colldb_2.to_pandas().columns), axis=1)
# In SixTrack loader, families are not (yet) loaded
df1 = df1.drop(['family', 'overwritten_keys'], axis=1)
df2 = df2.drop(['family', 'overwritten_keys'], axis=1)
# In SixTrack loader, families, and tilts are not loaded
df1 = df1.drop(['family', 'overwritten_keys', 'tilt'], axis=1)
df2 = df2.drop(['family', 'overwritten_keys', 'tilt'], axis=1)
# In SixTrack loader, non-active collimators default to active
df1_only_active = df1.drop(['tcsg.b4l7.b1', 'tcsg.e5r7.b1', 'tcsg.6r7.b1'], axis=0)
df1_only_active = df1_only_active.drop('parking', axis=1)
Expand All @@ -77,9 +77,9 @@ def test_loading_SixTrack_crystals():
colldb_2 = xc.CollimatorDatabase.from_SixTrack(path / 'colldb_lhc_run3_b1.dat', nemitt_x=3.5e-6, nemitt_y=3.5e-6, ignore_crystals=False)
df1 = colldb_1.to_pandas().reindex(sorted(colldb_1.to_pandas().columns), axis=1)
df2 = colldb_2.to_pandas().reindex(sorted(colldb_2.to_pandas().columns), axis=1)
# In SixTrack loader, families are not (yet) loaded
df1 = df1.drop(['family', 'overwritten_keys'], axis=1)
df2 = df2.drop(['family', 'overwritten_keys'], axis=1)
# In SixTrack loader, families, and tilts are not loaded
df1 = df1.drop(['family', 'overwritten_keys', 'tilt'], axis=1)
df2 = df2.drop(['family', 'overwritten_keys', 'tilt'], axis=1)
# In SixTrack loader, non-active collimators default to active
df1_only_active = df1.drop(['tcsg.b4l7.b1', 'tcsg.e5r7.b1', 'tcsg.6r7.b1'], axis=0)
df1_only_active = df1_only_active.drop('parking', axis=1)
Expand All @@ -90,46 +90,46 @@ def test_loading_SixTrack_crystals():
assert df1_only_active.equals(df2_only_active)


def test_dumping():
colldb_1 = xc.CollimatorDatabase.from_yaml(path / 'colldb_lhc_run3.yaml', beam=1)
colldb_2 = xc.CollimatorDatabase.from_yaml(path / 'colldb_lhc_run3.yaml', beam=2)
colldb_1.to_yaml('out1')
colldb_2.to_yaml('out2')
colldb_3 = xc.CollimatorDatabase.from_yaml('out1.yaml', beam=1)
colldb_4 = xc.CollimatorDatabase.from_yaml('out2.yaml', beam=2)
df1 = colldb_1.to_pandas().reindex(sorted(colldb_1.to_pandas().columns), axis=1)
df2 = colldb_2.to_pandas().reindex(sorted(colldb_2.to_pandas().columns), axis=1)
df3 = colldb_3.to_pandas().reindex(sorted(colldb_3.to_pandas().columns), axis=1)
df4 = colldb_4.to_pandas().reindex(sorted(colldb_4.to_pandas().columns), axis=1)
assert df1.equals(df3)
assert df2.equals(df4)
(Path.cwd() / 'out1.yaml').unlink()
(Path.cwd() / 'out2.yaml').unlink()


def test_dumping_from_Sixtrack():
colldb_yaml = xc.CollimatorDatabase.from_yaml(path / 'colldb_lhc_run3.yaml', beam=1,ignore_crystals=False)
colldb_dat = xc.CollimatorDatabase.from_SixTrack(path / 'colldb_lhc_run3_b1.dat', nemitt_x=3.5e-6, nemitt_y=3.5e-6, ignore_crystals=False)
colldb_dat.to_yaml('ne.to_pandas().lhc_run3')

colldb_yaml_new = xc.CollimatorDatabase.from_yaml('ne.to_pandas().lhc_run3.yaml', beam=1,ignore_crystals=False)
df_yaml = colldb_yaml.to_pandas().reindex(sorted(colldb_yaml.to_pandas().columns), axis=1)
df_dat = colldb_dat.to_pandas().reindex(sorted(colldb_dat.to_pandas().columns), axis=1)
df_yaml_new = colldb_yaml_new.to_pandas().reindex(sorted(colldb_yaml_new.to_pandas().columns), axis=1)

df_yaml = df_yaml.drop(['family', 'overwritten_keys', 'parking'], axis=1)
df_yaml_new = df_yaml_new.drop(['family', 'overwritten_keys', 'parking'], axis=1)
df_dat = df_dat.drop(['family', 'overwritten_keys', 'parking'], axis=1)

df_yaml_new = df_yaml_new.drop(['tcsg.b4l7.b1', 'tcsg.e5r7.b1', 'tcsg.6r7.b1'], axis=0)
df_yaml = df_yaml.drop(['tcsg.b4l7.b1', 'tcsg.e5r7.b1', 'tcsg.6r7.b1'], axis=0)
df_dat = df_dat.drop(['tcsg.b4l7.b1', 'tcsg.e5r7.b1', 'tcsg.6r7.b1'], axis=0)

df_yaml_new.sort_index(axis=0, inplace=True)
df_dat.sort_index(axis=0, inplace=True)
df_yaml.sort_index(axis=0, inplace=True)

assert df_dat.equals(df_yaml)
assert df_yaml_new.equals(df_yaml)
assert df_yaml_new.equals(df_dat)
(Path.cwd() / 'ne.to_pandas().lhc_run3.yaml').unlink()
# def test_dumping():
# colldb_1 = xc.CollimatorDatabase.from_yaml(path / 'colldb_lhc_run3.yaml', beam=1)
# colldb_2 = xc.CollimatorDatabase.from_yaml(path / 'colldb_lhc_run3.yaml', beam=2)
# colldb_1.to_yaml('out1')
# colldb_2.to_yaml('out2')
# colldb_3 = xc.CollimatorDatabase.from_yaml('out1.yaml', beam=1)
# colldb_4 = xc.CollimatorDatabase.from_yaml('out2.yaml', beam=2)
# df1 = colldb_1.to_pandas().reindex(sorted(colldb_1.to_pandas().columns), axis=1)
# df2 = colldb_2.to_pandas().reindex(sorted(colldb_2.to_pandas().columns), axis=1)
# df3 = colldb_3.to_pandas().reindex(sorted(colldb_3.to_pandas().columns), axis=1)
# df4 = colldb_4.to_pandas().reindex(sorted(colldb_4.to_pandas().columns), axis=1)
# assert df1.equals(df3)
# assert df2.equals(df4)
# (Path.cwd() / 'out1.yaml').unlink()
# (Path.cwd() / 'out2.yaml').unlink()


# def test_dumping_from_Sixtrack():
# colldb_yaml = xc.CollimatorDatabase.from_yaml(path / 'colldb_lhc_run3.yaml', beam=1,ignore_crystals=False)
# colldb_dat = xc.CollimatorDatabase.from_SixTrack(path / 'colldb_lhc_run3_b1.dat', nemitt_x=3.5e-6, nemitt_y=3.5e-6, ignore_crystals=False)
# colldb_dat.to_yaml('ne.to_pandas().lhc_run3')

# colldb_yaml_new = xc.CollimatorDatabase.from_yaml('ne.to_pandas().lhc_run3.yaml', beam=1,ignore_crystals=False)
# df_yaml = colldb_yaml.to_pandas().reindex(sorted(colldb_yaml.to_pandas().columns), axis=1)
# df_dat = colldb_dat.to_pandas().reindex(sorted(colldb_dat.to_pandas().columns), axis=1)
# df_yaml_new = colldb_yaml_new.to_pandas().reindex(sorted(colldb_yaml_new.to_pandas().columns), axis=1)

# df_yaml = df_yaml.drop(['family', 'overwritten_keys', 'parking', 'tilt'], axis=1)
# df_yaml_new = df_yaml_new.drop(['family', 'overwritten_keys', 'parking', 'tilt'], axis=1)
# df_dat = df_dat.drop(['family', 'overwritten_keys', 'parking', 'tilt'], axis=1)

# df_yaml_new = df_yaml_new.drop(['tcsg.b4l7.b1', 'tcsg.e5r7.b1', 'tcsg.6r7.b1'], axis=0)
# df_yaml = df_yaml.drop(['tcsg.b4l7.b1', 'tcsg.e5r7.b1', 'tcsg.6r7.b1'], axis=0)
# df_dat = df_dat.drop(['tcsg.b4l7.b1', 'tcsg.e5r7.b1', 'tcsg.6r7.b1'], axis=0)

# df_yaml_new.sort_index(axis=0, inplace=True)
# df_dat.sort_index(axis=0, inplace=True)
# df_yaml.sort_index(axis=0, inplace=True)

# assert df_dat.equals(df_yaml)
# assert df_yaml_new.equals(df_yaml)
# assert df_yaml_new.equals(df_dat)
# (Path.cwd() / 'ne.to_pandas().lhc_run3.yaml').unlink()
8 changes: 4 additions & 4 deletions tests/test_elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@
{'field': 'angle', 'val': 40, 'expected': {'_sin_zL': np.sin(40*np.pi/180), '_cos_zL': np.cos(40*np.pi/180), '_sin_zR': np.sin(40*np.pi/180), '_cos_zR': np.cos(40*np.pi/180)}},
{'field': 'angle', 'val': [40], 'expected': {'_sin_zL': np.sin(40*np.pi/180), '_cos_zL': np.cos(40*np.pi/180), '_sin_zR': np.sin(40*np.pi/180), '_cos_zR': np.cos(40*np.pi/180)}},
{'field': 'angle', 'val': [40, 47], 'expected': {'_sin_zL': np.sin(40*np.pi/180), '_cos_zL': np.cos(40*np.pi/180), '_sin_zR': np.sin(47*np.pi/180), '_cos_zR': np.cos(47*np.pi/180)}},
{'field': 'jaw', 'val': 0.015, 'expected': {'jaw_LU': 0.01512, 'jaw_RU': -0.015, 'jaw_LD': 0.01488, 'jaw_RD': -0.015, 'jaw_L': 0.015, 'jaw_R': -0.015, 'jaw': [[0.01512, -0.015], [0.01488, -0.015]], 'tilt_L': -0.0001692308, 'tilt_R': 0}}, # Existing tilt from base_fields
{'field': 'jaw', 'val': [0.015], 'expected': {'jaw_LU': 0.01512, 'jaw_RU': -0.015, 'jaw_LD': 0.01488, 'jaw_RD': -0.015, 'jaw_L': 0.015, 'jaw_R': -0.015, 'jaw': [[0.01512, -0.015], [0.01488, -0.015]], 'tilt_L': -0.0001692308, 'tilt_R': 0}},
{'field': 'jaw', 'val': [0.015, -0.014], 'expected': {'jaw_LU': 0.01512, 'jaw_RU': -0.014, 'jaw_LD': 0.01488, 'jaw_RD': -0.014, 'jaw_L': 0.015, 'jaw_R': -0.014, 'jaw': [[0.01512, -0.014], [0.01488, -0.014]], 'tilt_L': -0.0001692308, 'tilt_R': 0}},
{'field': 'jaw', 'val': [[0.015, -0.014],[0.0152, -0.0143]], 'expected': {'jaw_LU': 0.015, 'jaw_RU': -0.014, 'jaw_LD': 0.0152, 'jaw_RD': -0.0143, 'jaw_L': 0.0151, 'jaw_R': -0.01415, 'jaw': [[0.015, -0.014], [0.0152, -0.0143]], 'tilt_L': 0.0001538462, 'tilt_R': -0.0002307692}},
{'field': 'jaw', 'val': 0.015, 'expected': {'jaw_LU': 0.01512, 'jaw_RU': -0.015, 'jaw_LD': 0.01488, 'jaw_RD': -0.015, 'jaw_L': 0.015, 'jaw_R': -0.015, 'jaw': [[0.01512, 0.01488], [-0.015, -0.015]], 'tilt_L': -0.0001692308, 'tilt_R': 0}}, # Existing tilt from base_fields
{'field': 'jaw', 'val': [0.015], 'expected': {'jaw_LU': 0.01512, 'jaw_RU': -0.015, 'jaw_LD': 0.01488, 'jaw_RD': -0.015, 'jaw_L': 0.015, 'jaw_R': -0.015, 'jaw': [[0.01512, 0.01488], [-0.015, -0.015]], 'tilt_L': -0.0001692308, 'tilt_R': 0}},
{'field': 'jaw', 'val': [0.015, -0.014], 'expected': {'jaw_LU': 0.01512, 'jaw_RU': -0.014, 'jaw_LD': 0.01488, 'jaw_RD': -0.014, 'jaw_L': 0.015, 'jaw_R': -0.014, 'jaw': [[0.01512, 0.01488], [-0.014, -0.014]], 'tilt_L': -0.0001692308, 'tilt_R': 0}},
{'field': 'jaw', 'val': [[0.015, 0.0152], [-0.014, -0.0143]], 'expected': {'jaw_LU': 0.015, 'jaw_RU': -0.014, 'jaw_LD': 0.0152, 'jaw_RD': -0.0143, 'jaw_L': 0.0151, 'jaw_R': -0.01415, 'jaw': [[0.015, 0.0152], [-0.014, -0.0143]], 'tilt_L': 0.0001538462, 'tilt_R': -0.0002307692}},
{'field': 'tilt', 'val': 5.2e-3, 'expected': {'_sin_yL': np.sin(5.2e-3), '_cos_yL': np.cos(5.2e-3), '_sin_yR': np.sin(5.2e-3), '_cos_yR': np.cos(5.2e-3), '_tan_yL': np.tan(5.2e-3), '_tan_yR': np.tan(5.2e-3), 'jaw_LU': 0.01172001523251274, 'jaw_RU': -0.01752998476748726, 'jaw_LD': 0.018479984767487263, 'jaw_RD': -0.010770015232512739, 'jaw_L': 0.0151, 'jaw_R': -0.01415}},
{'field': 'tilt', 'val': [5.2e-3], 'expected': {'_sin_yL': np.sin(5.2e-3), '_cos_yL': np.cos(5.2e-3), '_sin_yR': np.sin(5.2e-3), '_cos_yR': np.cos(5.2e-3), '_tan_yL': np.tan(5.2e-3), '_tan_yR': np.tan(5.2e-3), 'jaw_LU': 0.01172001523251274, 'jaw_RU': -0.01752998476748726, 'jaw_LD': 0.018479984767487263, 'jaw_RD': -0.010770015232512739, 'jaw_L': 0.0151, 'jaw_R': -0.01415}},
{'field': 'tilt', 'val': [5.2e-3, 3.7e-3], 'expected': {'_sin_yL': np.sin(5.2e-3), '_cos_yL': np.cos(5.2e-3), '_sin_yR': np.sin(3.7e-3), '_cos_yR': np.cos(3.7e-3), '_tan_yL': np.tan(5.2e-3), '_tan_yR': np.tan(3.7e-3), 'jaw_LU': 0.01172001523251274, 'jaw_RU': -0.01655499451259542, 'jaw_LD': 0.018479984767487263, 'jaw_RD': -0.011745005487404576, 'jaw_L': 0.0151, 'jaw_R': -0.01415}},
Expand Down
4 changes: 2 additions & 2 deletions tests/test_impacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
[2, 'H']], ids=["B1H", "B2V", "B1V", "B2H"])
def test_impacts_from_line(beam, plane, test_context):
line = xt.Line.from_json(path / f'sequence_lhc_run3_b{beam}.json')
coll_manager = xc.CollimatorDatabase.from_yaml(path / 'colldb_lhc_run3.yaml', beam=beam)
coll_manager.install_everest_collimators(verbose=True, line=line)
colldb = xc.CollimatorDatabase.from_yaml(path / 'colldb_lhc_run3.yaml', beam=beam)
colldb.install_everest_collimators(verbose=True, line=line)
df_with_coll = line.check_aperture()
assert not np.any(df_with_coll.has_aperture_problem)

Expand Down
8 changes: 4 additions & 4 deletions tests/test_initial_distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ def test_create_initial_distribution(beam, npart,impact_parameter, pencil_spread

with flaky_assertions():
# Pencil: left jaw
pos_jawL_conv = coll_conv.jaw_L
pos_jawL_conv = coll_conv.jaw_LU
pos_partL_conv = part_conv.x[mask_conv_L].min()
pencil_spread_convL = part_conv.x[mask_conv_L].max() - pos_partL_conv
assert np.isclose(pencil_spread_convL, pencil_spread, atol=atol_spread)
assert pos_partL_conv - impact_parameter - pos_jawL_conv < atol_cut
assert pos_partL_conv - impact_parameter - pos_jawL_conv > 0

# Pencil: right jaw
pos_jawR_conv = coll_conv.jaw_R
pos_jawR_conv = coll_conv.jaw_RU
pos_partR_conv = part_conv.x[mask_conv_R].max()
pencil_spread_convR = pos_partR_conv - part_conv.x[mask_conv_R].min()
assert np.isclose(pencil_spread_convR, pencil_spread, atol=atol_spread)
Expand Down Expand Up @@ -117,15 +117,15 @@ def test_create_initial_distribution(beam, npart,impact_parameter, pencil_spread

with flaky_assertions():
# Pencil: left jaw
pos_jawL_div = coll_div.jaw_L
pos_jawL_div = coll_div.jaw_LD
pos_partL_div = part_div.y[mask_div_L].min()
pencil_spread_divL = part_div.y[mask_div_L].max() - pos_partL_div
assert np.isclose(pencil_spread_divL, pencil_spread, atol=atol_spread)
assert pos_partL_div - impact_parameter - pos_jawL_div < atol_cut
assert pos_partL_div - impact_parameter - pos_jawL_div > 0

# Pencil: right jaw
pos_jawR_div = coll_div.jaw_R
pos_jawR_div = coll_div.jaw_RD
pos_partR_div = part_div.y[mask_div_R].max()
pencil_spread_divR = pos_partR_div - part_div.y[mask_div_R].min()
assert np.isclose(pencil_spread_divR, pencil_spread, atol=atol_spread)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
from xcoll import __version__

def test_version():
assert __version__ == '0.5.9'
assert __version__ == '0.5.10'
Loading

0 comments on commit afe4c9d

Please sign in to comment.