Skip to content

Commit 89ba2d4

Browse files
committed
test measurement_analysis
1 parent 7fa1d9a commit 89ba2d4

File tree

7 files changed

+557
-7
lines changed

7 files changed

+557
-7
lines changed

examples/commissioning_2022.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,10 +305,10 @@ def plot_corrector_strengths():
305305

306306
# Run --------------------------------------------------------------------------
307307

308-
if __name__ == '__main__':
308+
if __name__ == '__main__': # pragma: no cover
309309
log_setup()
310310
lhc_beams = None # in case you want to skip the simulation
311-
# lhc_beams = simulation()
311+
lhc_beams = simulation()
312312
do_correction(lhc_beams=lhc_beams)
313313
check_correction(lhc_beams=lhc_beams)
314314
plot_detuning_comparison()

examples/md3311.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ def plot_detunig_compensation():
301301

302302
# Run --------------------------------------------------------------------------
303303

304-
if __name__ == '__main__':
304+
if __name__ == '__main__': # pragma: no cover
305305
log_setup()
306306
lhc_beams = None # in case you want to skip the simulation
307307
lhc_beams = simulation()

examples/md6863.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ def plot_target_comparison():
631631

632632
# Run --------------------------------------------------------------------------
633633

634-
if __name__ == '__main__':
634+
if __name__ == '__main__': # pragma: no cover
635635
log_setup()
636636
lhc_beams = None # in case you want to skip the simulation
637637
lhc_beams = simulation()

ir_amplitude_detuning/utilities/measurement_analysis.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class AnalysisOption(StrEnum):
4545

4646
def get_beam_from_dir(analysis_dir: Path) -> int:
4747
"""Determine the beam number from the analysis directory.
48-
Assumes either the directory name is of the form ``B{beam}_`` or
48+
Assumes either the directory name is of the form ``B{beam}_``/``b{beam}_`` or
4949
the parent or the parent directory is of the form ``LHCB{beam}``.
5050
5151
Args:
@@ -54,7 +54,7 @@ def get_beam_from_dir(analysis_dir: Path) -> int:
5454
Returns:
5555
int: The beam number
5656
"""
57-
if match := re.match(r"^B(\d)_", analysis_dir.name):
57+
if match := re.match(r"^B(\d)_", analysis_dir.name, flags=re.IGNORECASE):
5858
return int(match.group(1))
5959

6060
gui_machine_dir = analysis_dir.absolute().parents[1] # LHCB#/Results/Analysis

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ omit = [
108108
exclude_also = [
109109
"if TYPE_CHECKING:", # do not count type checking imports (ignored at runtime) for coverage
110110
"except ImportError:", # do not count missing optional dependencies set to None, we monkeypatch and test that
111-
"if __name__ == \"__main__\":", # do not count entry-points (in examples only); we test the functions directly
112111
]
113112

114113
# ----- Dev Tools Configuration ----- #
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
@ Measure_optics:version %s "0.4.0"
2+
@ Command %s "python make_analysis"
3+
@ CWD %s "my_cwd"
4+
@ Date %s "12. July 2022, 16:04:36"
5+
@ Model_directory %s "b1_30cm"
6+
@ Compensation %s "by model"
7+
@ Q1 %le 0.27998842435500393
8+
@ Q2 %le 0.3099860733499966
9+
@ RescalingFactorX %le 1.000606165206714
10+
@ RescalingFactorY %le 1.0067746669006474
11+
@ ODR_dQXd2JX_COEFF0 %le 0.28016503286702676
12+
@ ODR_dQXd2JX_ERRCOEFF0 %le 1.155263876804028e-05
13+
@ ODR_dQXd2JX_COEFF1 %le -32209.77442163995
14+
@ ODR_dQXd2JX_ERRCOEFF1 %le 3384.46122805569
15+
@ ODR_dQYd2JX_COEFF0 %le 0.30983684442567894
16+
@ ODR_dQYd2JX_ERRCOEFF0 %le 9.16011158268422e-06
17+
@ ODR_dQYd2JX_COEFF1 %le 55112.82068518765
18+
@ ODR_dQYd2JX_ERRCOEFF1 %le 2075.2520018162136
19+
@ ODR_dQXd2JX_CORRCOEFF0 %le 2.443949536369067e-05
20+
@ ODR_dQXd2JX_ERRCORRCOEFF0 %le 7.421759440893851e-06
21+
@ ODR_dQXd2JX_CORRCOEFF1 %le -25059.924191527414
22+
@ ODR_dQXd2JX_ERRCORRCOEFF1 %le 1873.560446932308
23+
@ ODR_dQYd2JX_CORRCOEFF0 %le 4.927028596965795e-05
24+
@ ODR_dQYd2JX_ERRCORRCOEFF0 %le 9.066255056779466e-06
25+
@ ODR_dQYd2JX_CORRCOEFF1 %le 34493.584047847944
26+
@ ODR_dQYd2JX_ERRCORRCOEFF1 %le 1931.467372460784
27+
* TIME DPPX DPPAMPX QX ERRQX NATQX ERRNATQX sqrt2JX ERRsqrt2JX 2JX ERR2JX sqrt2JXRES ERRsqrt2JXRES 2JXRES ERR2JXRES DPPY DPPAMPY QY ERRQY NATQY ERRNATQY sqrt2JY ERRsqrt2JY 2JY ERR2JY sqrt2JYRES ERRsqrt2JYRES 2JYRES ERR2JYRES BBQXMAV ERRBBQXMAV BBQYMAV ERRBBQYMAV NATQXCORR ERRNATQXCORR NATQYCORR ERRNATQYCORR
28+
$ %s %le %le %le %le %le %le %le %le %le %le %le %le %le %le %le %le %le %le %le %le %le %le %le %le %le %le %le %le %le %le %le %le %le %le %le %le
29+
"2022_06_25@03_37_46_464453" 0 0 0.270988387385 2.66571562631e-07 0.280141454982 3.93830101129e-06 1.68439511206e-05 6.41659859539e-07 2.83336967667e-10 2.15656382837e-11 1.68541613377e-05 6.4204881142e-07 2.83508716679e-10 2.15787106232e-11 0 0 0.316986082014 4.3304013192e-08 0.309869261813 1.72718088373e-05 3.20969724259e-05 7.77166572281e-07 1.02928627069e-09 4.98528853655e-11 3.23144187226e-05 7.82431616935e-07 1.03625934232e-09 5.01906220579e-11 0.280143370853 2.01341151135e-06 0.309810264934 4.28046095265e-06 -1.91587113502e-06 4.4231256787e-06 5.89968792359e-05 1.77943172524e-05

0 commit comments

Comments
 (0)