Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Runs linting on the codebase with Ruff
name: Ruff linting

defaults:
run:
shell: bash

# Runs on the following conditions:
# - Any push to a branch linked to a pull request
# -> if the pushed commit changes files within the codebase (in pyhdtoolkit/ or tests/ directories)
# -> or if the pushed commit changes the pyproject.toml configuration file
on:
pull_request:
paths:
- 'pyhdtoolkit/**'
- 'tests/**'
- 'pyproject.toml'

jobs:
linter:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

# This runs ruff check by default, our pyproject.toml has the config
- uses: astral-sh/ruff-action@v3
with:
version: "latest"
src: "pyhdtoolkit/"
1 change: 1 addition & 0 deletions docs/releases/v1.8.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Enhancements

* The regex parsing in the `HTCondor` utilities has been made more robust.
* The whole package now consistently makes use of postponed evaluations of annotations (see PEP 563).
* Some operations have been fixed to adapt to the default behaviors of `pandas 3.x`.

Documentation
~~~~~~~~~~~~~
Expand Down
6 changes: 3 additions & 3 deletions pyhdtoolkit/cpymadtools/lhc/_routines.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ def do_kmodulation(
logger.trace(f"Modulation of '{element}' - Setting '{powering_variable}' to {powering}")
madx.globals[powering_variable] = powering
twiss_df = get_ir_twiss(madx, ir=ir, centre=True, columns=["k1l", "l"], **kwargs)
results.loc[powering].K = twiss_df.loc[element.lower()].k1l / twiss_df.loc[element.lower()].l # Store K
results.loc[powering].TUNEX = madx.table.summ.q1[0] # Store Qx
results.loc[powering].TUNEY = madx.table.summ.q2[0] # Store Qy
results.at[powering, "K"] = twiss_df.loc[element.lower()].k1l / twiss_df.loc[element.lower()].l # Store K
results.at[powering, "TUNEX"] = madx.table.summ.q1[0] # Store Qx
results.at[powering, "TUNEY"] = madx.table.summ.q2[0] # Store Qy

logger.debug(f"Resetting '{element}' powering")
madx.globals[powering_variable] = old_powering
Expand Down
Loading