Skin map issue for python 3.x

Issue #946 resolved
David Platten created an issue

The behaviour of the “round” function in python 3.x is different to that of 2.x which causes an issue when the openSkin code calculates points around the phantom in the phantom3 routine in the geomclass.py file.

https://stackoverflow.com/questions/10825926/python-3-x-rounding-behavior

Comments (5)

  1. Ed McDonagh

    Does it need fixing?

    I presume we're not using Decimal here, else it can be modified to behave as we previously expected.

  2. David Platten reporter

    Replacing use of built in python round function with a custom method because the in-built one (and Numpy's) both use Banker's Rounding, which does not follow the mathematical convention. The difference in rounding affects the calculation of points around the surface of the 3d openSkin phantom. Refs issue #946 (and sort-of references issue #933). Ed: apologies if you don't like that I've committed this into the 933 branch rather than creating a branch of its own.

    → <<cset c54bf2ec3f88>>

  3. David Platten reporter

    Changed round_properly to a function and reordered imports (following Codacy comments). Removed print statements and exit() command. Added int() around the elements of a numpy.zeros statement to avoid an error. Refs issue #946 (and sort of references issue #933)

    → <<cset 32e1bbc9a901>>

  4. Log in to comment