Skip to content

Refactor parsing arguments and loading main notebook

Thomas Kluyver requested to merge refactor/calibrate-argv into master

Description

This is meant to make the code powering xfel-calibrate easier to read and to test. In particular:

  • About 400 lines of code for argument handling are split out of calibrate.py, which was getting very long.
  • The main run() function now takes an optional argv= parameter, so we can test it without monkeypatching sys.argv.
  • I've tried to better separate the code for parsing arguments from the code that actually writes files and launches jobs. The first bit should be easier to test, as it doesn't have side effects.

Closes #51

A large part of the diff is simply moving code from calibrate.py to nb_args.py. This is the first commit in the branch, so hopefully it's easy to look at the diff from after that commit. Edit: here's the Gitlab view of that diff.

How Has This Been Tested?

Running the automated test suite.

Types of changes

  • Refactor (refactoring code with no functionality changes)

Checklist:

  • My code follows the code style of this project.

Reviewers

@roscar @ahmedk @danilevc

Edited by Thomas Kluyver

Merge request reports