WIP: Fix up division in preparation for scap3
AbandonedPublic

Authored by demon on Dec 11 2017, 5:01 PM.

Details

Reviewers
mmodell
Group Reviewers
Release-Engineering-Team
Patch without arc
git checkout -b D913 && curl -L https://phabricator.wikimedia.org/D913?download=true | git apply
Summary
************* Module scap.main
W:113,32: division w/o __future__ statement (old-division)
************* Module scap.targets
W:283,32: division w/o __future__ statement (old-division)
W:312,41: division w/o __future__ statement (old-division)
************* Module scap.log
W:361,35: division w/o __future__ statement (old-division)
W:436,20: division w/o __future__ statement (old-division)
W:440,14: division w/o __future__ statement (old-division)

main.py: The one usage of division is only working with integers, so retaining floor behavior in py3 is best

targets.py:

  • Skipped for now
  • subgroup labels are all integers as well, so just keep floor division

log.py: All three division usages are for percentage calculations, so make use of future division

Diff Detail

demon created this revision.Dec 11 2017, 5:01 PM
Restricted Application added a reviewer: mmodell. · View Herald TranscriptDec 11 2017, 5:01 PM
Restricted Application added a reviewer: Release-Engineering-Team. · View Herald Transcript
Restricted Application added a project: Release-Engineering-Team. · View Herald Transcript
demon requested review of this revision.Dec 11 2017, 5:03 PM
mmodell accepted this revision.Dec 11 2017, 6:31 PM
This revision is now accepted and ready to land.Dec 11 2017, 6:31 PM
demon added inline comments.Dec 11 2017, 7:28 PM
scap/targets.py
283

Thoughts on the correct behavior for this one?

mmodell added inline comments.Dec 11 2017, 7:33 PM
scap/targets.py
283

hmmm. I guess we want floor division? partial failures aren't helpful. Then again it might not hurt to have this result in a float.

demon added inline comments.Dec 11 2017, 8:02 PM
scap/targets.py
283

Existing tests resulted in failure when I tried floor with //

demon abandoned this revision.Dec 21 2017, 2:05 AM

Let's do them case by case