pylhc / omc3

Python 3 codes for beam optics measurements and corrections in circular particle accelerators

Home Page:https://pylhc.github.io/omc3/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Kmod default errors

mihofer opened this issue · comments

Documentation

  • Yes

Operating System

CentOS 7.9

Python Version

3.7

Package Version

2.1

Bug Description

If the run_kmod is run without specifying with all errors, the script crashes with an Attribute Error: 'ip'

Steps to Reproduce

Execute run_kmod script without the options cminus, 'errorK', 'errorL'

Relevant output

self = {'betastar_and_waist': {'X': array([ 200., -100.]), 'Y': array([ 200., -100.])}, 'working_directory': PosixPath('/tmp/....L4B2'], 'interaction_point': None, 'measurement_dir': None, 'phase_weight': 0.0, 'model_dir': None, 'outputdir': None}
key = 'ip'

    def __getattr__(self, key):
        """Needed to raise the correct exceptions."""
        try:
>           return super(DotDict, self).__getitem__(key)
E           AttributeError: 'ip'

Possible Fix Implementation

In run_kmod L 304, options.ip should be renamed to options.interaction_point, as this was missed during some renaming.
Additionally, a test should cover this scenario.

Can you take care of it @mihofer?