Skip to content

Commit cf22df6

Browse files
awegschefsoubelet
andauthored
remove S intersection while merging in coupling (#368)
* remove intersection while merging in coupling * changelog and version number Co-authored-by: Felix Soubelet <[email protected]>
1 parent 39fea41 commit cf22df6

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# OMC3 Changelog
22

3+
#### 2022-04-25
4+
5+
- Fixed:
6+
- Only perform index merging on the `NAME` column during coupling calculation. This solves an (at the moment) un-understood issue where some BPMs would have different `S` values in different files.
7+
38
#### 2022-04-12
49

510
- Fixed:

omc3/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
__title__ = "omc3"
1212
__description__ = "An accelerator physics tools package for the OMC team at CERN."
1313
__url__ = "https://github.com/pylhc/omc3"
14-
__version__ = "0.2.5"
14+
__version__ = "0.2.6"
1515
__author__ = "pylhc"
1616
__author_email__ = "[email protected]"
1717
__license__ = "MIT"

omc3/optics_measurements/coupling.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -371,13 +371,13 @@ def _joined_frames(input_files: dict) -> tfs.TfsDataFrame:
371371
merged_transverse_lins_df = pd.merge(
372372
left=linx,
373373
right=liny,
374-
on=[NAME, S],
374+
on=[NAME],
375375
how="inner",
376376
sort=False,
377377
)
378378
joined_dfs.append(merged_transverse_lins_df)
379379

380-
partial_merge = partial(pd.merge, how="inner", on=[NAME, S], sort=False)
380+
partial_merge = partial(pd.merge, how="inner", on=[NAME], sort=False)
381381
reduced = reduce(partial_merge, joined_dfs).set_index(NAME)
382382
reduced = reduced.rename(
383383
columns={f"{PHASE_ADV}X_X_0": f"{PHASE_ADV}X", f"{PHASE_ADV}Y_Y_0": f"{PHASE_ADV}Y"}
@@ -398,7 +398,7 @@ def rename_col(plane: str, index: int) -> Callable:
398398
"""
399399

400400
def fn(column):
401-
if column in [NAME, S]:
401+
if column == NAME:
402402
return column
403403
return f"{column}_{plane}_{index}"
404404

0 commit comments

Comments
 (0)