Skip to content

Commit

Permalink
Added raw strings and/or backslashes
Browse files Browse the repository at this point in the history
  • Loading branch information
JoschD committed Jul 21, 2023
1 parent 1cd4378 commit e998f95
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion omc3/check_corrections.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
Filepattern to use to find correction files in folders (as regex).
default: ``^changeparameters*?\.madx$``
default: ``^changeparameters*?\\.madx$``
- **individual_to_input**:
Expand Down
2 changes: 1 addition & 1 deletion omc3/correction/sequence_evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def _create_basic_job(accel_inst: Accelerator, k_values: List[str], variables: S
# create a survey and save it to a temporary file
job_content += (
"select, flag=survey, clear;\n"
f"select, flag=survey, pattern='^M.*\.B{accel_inst.beam:d}$', COLUMN=NAME, L;\n"
f"select, flag=survey, pattern='^M.*\\.B{accel_inst.beam:d}$', COLUMN=NAME, L;\n"
"survey, file='%(TEMPFILE)s';\n"
"readmytable, file='%(TEMPFILE)s', table=mytable;\n"
"n_elem = table(mytable, tablelength);\n"
Expand Down
6 changes: 3 additions & 3 deletions omc3/definitions/optics.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ def delta_label(self):
return self._delta_label

if self.label.startswith("$"):
return f"$\Delta {self.label[1:]}"
return f"$\Delta$ {self.label}"
return fr"$\Delta {self.label[1:]}"
return fr"$\Delta$ {self.label}"


# Defined Columns --------------------------------------------------------------
Expand All @@ -195,7 +195,7 @@ def delta_label(self):
NORM_DISPERSION_COLUMN = ColumnsAndLabels(NORM_DISPERSION, _label=ylabels['norm_dispersion'], _text_label='normalized dispersion')
PHASE_COLUMN = ColumnsAndLabels(PHASE, _label=ylabels['phase'], _text_label='phase')
TOTAL_PHASE_COLUMN = ColumnsAndLabels(PHASE, _label=ylabels['phase'], _text_label='total phase')
PHASE_ADVANCE_COLUMN = ColumnsAndLabels(f'{PHASE_ADV}{{0}}{MDL}', _label='Phase Advance [$2 \pi$]', _text_label='phase advance')
PHASE_ADVANCE_COLUMN = ColumnsAndLabels(f'{PHASE_ADV}{{0}}{MDL}', _label=r'Phase Advance [$2 \pi$]', _text_label='phase advance')
S_COLUMN = ColumnsAndLabels(S, _label='Location [m]', _text_label='longitudinal location', needs_plane=False)

RDT_AMPLITUDE_COLUMN = ColumnsAndLabels(AMPLITUDE, _label=ylabels['absolute'], _text_label='amplitude', needs_plane=False) # label needs rdt
Expand Down
2 changes: 1 addition & 1 deletion omc3/plotting/plot_optics_measurements.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
- **ip_search_pattern**: In case your IPs have a weird name. Specify regex pattern.
Default: ``IP\d$``
Default: ``IP\\d$``
- **lines_manual** *(DictAsString)*: List of manual lines to plot.
Need to contain arguments for axvline, and may contain the additional keys "text"
and "loc" which is one of ['bottom', 'top', 'line bottom', 'line top']
Expand Down
2 changes: 1 addition & 1 deletion omc3/scripts/merge_kmod_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def get_lumi_imbalance(data_frame: tfs.TfsDataFrame) -> Tuple[UFloat, UFloat, UF
.. math::
\\sigma_{\\frac{L_{IP1}}{L_{IP5}}} = \\frac{1}{2}\\frac{L_{IP1}}{L_{IP5}}
\\cdot \\sqrt{\\sum_{\substack{z \\in (x,y) \\\\ i \\in (IP1, IP5) }}
\\cdot \\sqrt{\\sum_{\\substack{z \\in (x,y) \\\\ i \\in (IP1, IP5) }}
{\\frac{\\sigma^2_{\\beta_{z1,i}} + \\sigma^2_{\\beta_{z2,i}}} {(\\beta_{z1,i}+\\beta_{z2,i})^2}}}
Args:
Expand Down
2 changes: 1 addition & 1 deletion omc3/tune_analysis/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def get_tune_label(plane: str, scale: int = None) -> str:
""" Tune label for the action/tune plots. """
unit = ""
if scale:
unit = f" \quad [10^{{{scale:d}}}]"
unit = fr" \quad [10^{{{scale:d}}}]"
return fr"$\Delta Q_{plane.lower():s}{unit}$"


Expand Down

0 comments on commit e998f95

Please sign in to comment.