Skip to content

Commit 17ad36f

Browse files
committed
Support getting the rigidity from multipoles
1 parent d517e76 commit 17ad36f

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/pytac/load_csv.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,14 @@ def load_unitconv(mode_dir: Path, lattice: Lattice) -> None:
165165
# For certain magnet types, we need an additional rigidity
166166
# conversion factor as well as the raw conversion.
167167
# TODO: This should probably be moved into the .csv files somewhere.
168-
rigidity_families = {"hstr", "vstr", "quadrupole", "sextupole", "bend"}
168+
rigidity_families = {
169+
"hstr",
170+
"vstr",
171+
"quadrupole",
172+
"sextupole",
173+
"multipole",
174+
"bend",
175+
}
169176
if item["uc_type"] != "null" and element._families & rigidity_families:
170177
energy = lattice.get_value("energy", units=pytac.ENG)
171178
uc.set_post_eng_to_phys(utils.get_div_rigidity(energy))

src/pytac/units.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,7 @@ def eng_to_phys(self, value):
128128
"""
129129
if self.lower_limit is not None and value < self.lower_limit:
130130
raise UnitsException(
131-
f"{self}: Input less than lower "
132-
f"conversion limit ({self.lower_limit})."
131+
f"{self}: Input less than lower conversion limit ({self.lower_limit})."
133132
)
134133
if self.upper_limit is not None and value > self.upper_limit:
135134
raise UnitsException(

0 commit comments

Comments
 (0)