Run skinmap code through black
Previously left as code is being reworked by @wens but it should be done as the new skinmap code is likely to be after release 1.0 and it currently causes issues with checking the rest of the code for black (forever having to revert).
Refs issue #841
Comments (9)
-
reporter -
reporter Replaced .format with f-strings. Removed hopefully unused Py2->3 libraries, one left need to check if can remove. Refs
#852→ <<cset 6b1e1ed53086>>
-
reporter @Jonathan Cole @David Platten @wens @Luuk Can I have some advice please?
In
make_skin_map.py
we are currently usingold_div
, and I want to remove the dependency but I am not sure what the right thing to do is.In release 0.9.0, the code in question looked like this:
my_exp_map.my_dose.totalDose = np.roll(my_exp_map.my_dose.totalDose, int(my_exp_map.phantom.phantom_flat_dist / 2), axis=0) try: my_exp_map.my_dose.totalDose = np.rot90(my_exp_map.my_dose.totalDose) except ValueError: pass
In preparation for moving to Python 3, the automatic tools I used imported
old_div
and changed it to this in 0.9.1 and the current release:my_exp_map.my_dose.totalDose = np.roll(my_exp_map.my_dose.totalDose, int(old_div(my_exp_map.phantom.phantom_flat_dist, 2)), axis=0) try: my_exp_map.my_dose.totalDose = np.rot90(my_exp_map.my_dose.totalDose) except ValueError: pass
I want to remove the import and just have a Python 3 division, but I don’t know if we need float division `/` or floor division Python 2 style `//`.
Please advise!
-
Given that I wrapped it in an int I suspect floor division would reproduce the same output as the current code. It certainly doesn’t need the added precision of making it all float and would probably break something further on if we did add that precision in.
-
reporter Thanks Jon. I’ll do that and merge it in.
-
reporter Used floor division to remove requirement for past.utils. Refs
#852→ <<cset 1832b42fb9eb>>
-
reporter Adding ref
#852to changes. Issue was fixed with PR #392 merged in 099f85c9→ <<cset 4d03222c0bab>>
-
reporter - changed status to resolved
-
reporter - changed component to openSkin
- Log in to comment
Reformatted skin map files with black. Refs
#852. Shouldn't have any functional effect.→ <<cset 9d3529c0eb83>>