Skip to content
Snippets Groups Projects

Provide a CLI option for changing configurations

Merged Steffen Hauf requested to merge feat/update_config into master
3 unresolved threads

@karnem @ahmedk

@moellerj: FYI as you requested this, please let me know if it suits your needs. If so we will deploy and you can test. @jsztuk: FYI as it currently refers to AGIPD

Options to change, etc. can be adapted in the future

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
27
28 # remove help calls as they will cause the argument parser to exit
29 add_help = False
30 if "-h" in sys.argv:
31 sys.argv.remove("-h")
32 add_help = True
33 if "--help" in sys.argv:
34 sys.argv.remove("--help")
35 add_help = True
36
37 known, remaining = parser.parse_known_args()
38 args = vars(known)
39 detector = args["detector"]
40
41 for option, typ in available_options[detector].items():
42 parser.add_argument(f"--{option}", type=typ)
  • Apart small comment LGTM.

  • 112 113 socket.send(Success.UPLOADED_CONFIG.format(cycle, proposal).encode())
    113 114
    114 115
    116 def merge(source, destination):
    117 """
    118 Deep merge two dictionaries
    119
    120 :param source: source dictionary to merge into destination
    121 :param destination: destination dictionary which is being merged in
    122 :return: the updated destination dictionary
    123
    124 Taken from: https://stackoverflow.com/questions/20656135/python-deep-merge-dictionary-data
  • Karim Ahmed added 1 commit
  • 30 if "-h" in sys.argv:
    31 sys.argv.remove("-h")
    32 add_help = True
    33 if "--help" in sys.argv:
    34 sys.argv.remove("--help")
    35 add_help = True
    36
    37 known, remaining = parser.parse_known_args()
    38 args = vars(known)
    39 detector = args["detector"]
    40
    41 for option, typ in available_options[detector].items():
    42 parser.add_argument(f"--{option}", type=typ)
    43
    44 if add_help:
    45 sys.argv.append("--help")
  • Karim Ahmed added 1 commit

    added 1 commit

    • ade84c46 - fix/key-error when using empty --help

    Compare with previous version

  • Karim Ahmed added 1 commit

    added 1 commit

    • d3d3137f - changes by Misha from xcal-test

    Compare with previous version

  • Karim Ahmed added 1 commit

    added 1 commit

    Compare with previous version

  • Karim Ahmed added 1 commit

    added 1 commit

    • f35c88cc - add req arguments parser group

    Compare with previous version

  • @karnem Tests has been done successfully and can be seen on calibration_configurations remote repository and changes have been pushed to this branch. Please review last changes so we can merge and ask Johannes to try after.

  • LGTM.

  • thank you for the review

  • merged

  • Karim Ahmed mentioned in commit fdafde0d

    mentioned in commit fdafde0d

  • Please register or sign in to reply
    Loading