Skip to content

Commit

Permalink
Remove scripts & fix some logging (#35)
Browse files Browse the repository at this point in the history
* remove scripts and unused deps, update lock file

* add utility to re-cycle a sequence

* fix logging error in matching
  • Loading branch information
fsoubelet committed Feb 19, 2021
1 parent 6ddeefc commit 1ec6e88
Show file tree
Hide file tree
Showing 12 changed files with 63 additions and 1,500 deletions.
161 changes: 44 additions & 117 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyhdtoolkit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
__title__ = "pyhdtoolkit"
__description__ = "An all-in-one toolkit package to easy my Python work in my PhD."
__url__ = "https://github.com/fsoubelet/PyhDToolkit"
__version__ = "0.8.0"
__version__ = "0.8.1"
__author__ = "Felix Soubelet"
__author_email__ = "felix.soubelet@cern.ch"
__license__ = "MIT"
2 changes: 1 addition & 1 deletion pyhdtoolkit/cpymadtools/matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def match(*args, **kwargs):
if q1_target and q2_target and dq1_target and dq2_target:
logger.info(
f"Doing combined matching to Qx={q1_target}, Qy={q2_target}, "
f"dq={dq1_target}, dqy={dq2_target} for sequence '{sequence}'"
f"dqx={dq1_target}, dqy={dq2_target} for sequence '{sequence}'"
)
logger.trace(f"Vary knobs sent are {varied_knobs}")
match(*varied_knobs, q1=q1_target, q2=q2_target, dq1=dq1_target, dq2=dq2_target)
Expand Down
16 changes: 16 additions & 0 deletions pyhdtoolkit/cpymadtools/special.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,22 @@ def make_lhc_thin(madx: Madx, sequence: str, slicefactor: int = 1, **kwargs) ->
madx.command.makethin(sequence=sequence, style=style, makedipedge=makedipedge)


def re_cycle_sequence(madx: Madx, sequence: str = "lhcb1", start: str = "IP3") -> None:
"""
Re-cycle the provided sequence from a different starting point.
Args:
madx (Madx): an instantiated cpymad.madx.Madx object.
sequence (str): the sequence to re cycle.
start (str): element to start the new cycle from.
"""
logger.debug(f"Re-cycling sequence '{sequence}' from {start}")
madx.command.seqedit(sequence=sequence)
madx.command.flatten()
madx.command.cycle(start=start)
madx.command.endedit()


# ----- Twiss Utilities ----- #


Expand Down
9 changes: 0 additions & 9 deletions pyhdtoolkit/scripts/__init__.py

This file was deleted.

Empty file.
Loading

0 comments on commit 1ec6e88

Please sign in to comment.