Skip to content
Snippets Groups Projects

Fix import * in agipdlib

Merged Cyril Danilevski requested to merge fix/agipdlib_import_star into master
2 unresolved threads

Description

Going through a few CI logs, I noticed that cal_tools/cal_tools/agipdlib.py was flagged a few times due to its from agipdutils import *.
This fixes that, as well as a few other pep8 violations.

No logic changes were introduced.

How Has This Been Tested?

This was tested by running python agipdlib.py to ensure that the file can be loaded fine.

Types of changes

  • Code cleanup

Checklist:

  • My code follows the code style of this project.

Reviewers

@roscar @ahmedk @hammerd @schmidtp

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
203 210 self.rng_pulses = max_pulses
204 211 # avoid list(range(*[0]]))
205 212 self.pulses_lst = list(range(*max_pulses)) \
206 if not (len(max_pulses) == 1 and max_pulses[0] == 0) else max_pulses #noqa
213 if not (len(max_pulses) == 1 and max_pulses[0] == 0) else max_pulses # noqa
  • Forgive me for derailing this MR, and ignore it for merging purposes, but... why is there an # noqa in this line? Only because the author didn't like some linters opinion?

  • That's okay.

    The whole line is 80 characters, barely triggering pep8. But it's so because of the line break.

    The whole thing could be:

    Suggested change
    212 self.pulses_lst = list(range(*max_pulses)) \
    213 if not (len(max_pulses) == 1 and max_pulses[0] == 0) else max_pulses # noqa
    212 self.pulses_lst = max_pulses if max_pulses == [0] else list(range(*max_pulses))

    But i did not want to touch the logic in this MR

  • Please register or sign in to reply
  • added 1 commit

    Compare with previous version

  • I pushed once more because I used a different version of isort.
    If that's fine, I'll merge at the end of the day :)

  • Thanks everyone!

  • mentioned in commit 429d7e2a

  • Please register or sign in to reply
    Loading