1. 11 Jan, 2021 1 commit
  2. 04 Jan, 2021 1 commit
  3. 29 Mar, 2020 1 commit
    • Rasmus Wriedt Larsen's avatar
      Minor Python tweaks (#2616) · c87b96fb
      Rasmus Wriedt Larsen authored
      * Use list-comprehension in Python code
      
      A minor change, but slighly easier to understand the initialization of
      `parent_exclude_list` in my opinion.
      
      * Implement __ne__ in Python classes that has __eq__
      
      In Python 3, `__ne__` is automatically implemented as `not __eq__`.
      
      However, in Python 2 it seems to be implemented as `not is` (so based on object
      identity).
      
      Based on setup.py [0] which says that "OpenMM requires Python 2.7 or better", it
      should be useful to have better support for Python 2 :)
      
      This was already done in 4 of the 12 classes that implements `__eq__`
      
      ```
      >>> class WildCard(object):
      ...     def __eq__(self, other): return True
      
      >>> w = WildCard()
      
      >>> w == 42
      True
      
      >>> w != 42
      True
      
      >>> w != w
      False
      ```
      
      [0]: https://github.com/openmm/openmm/blob/5cef29ce8d4e17b6d0f9fd8a3c6cc1669ca0ba2b/wrappers/python/setup.py#L237
      
      * Use umambiguous floor division for index calculations in Python
      
      This makes the code work as intended if run as Python 3
      
      ```
      $ python2 -c 'print(3/2, 3//2)'
      (1, 1)
      $ python3 -c 'print(3/2, 3//2)'
      1.5 1
      ```
      
      * Use `with` for file handling in Python
      
      * Use `is None` instead of `== None` in Python
      
      This is recommended in PEP8:
      
      > Comparisons to singletons like None should always be done with is or is not, never the equality operators.
      > - https://www.python.org/dev/peps/pep-0008/#programming-recommendations
      c87b96fb
  4. 04 Nov, 2019 1 commit
  5. 24 Oct, 2019 1 commit
  6. 08 Oct, 2018 1 commit
  7. 28 Nov, 2017 1 commit
  8. 22 Feb, 2017 1 commit
  9. 11 Nov, 2016 1 commit
  10. 30 Sep, 2015 1 commit
    • Jason Swails's avatar
      Fix very irritating behavior on some Mac systems. · 9570ab9c
      Jason Swails authored
      Hard-code CC and CXX to clang for Macs, since gcc/g++ will *not* work with
      Anaconda, despite the fact that distutils will try to use them.  System Python,
      homebrew, and MacPorts on Macs will always use clang, so this hack should always
      work and fix issues with users that have GCC installed from MacPorts or homebrew
      *and* Anaconda.
      9570ab9c
  11. 27 Aug, 2015 1 commit
  12. 14 Jul, 2015 1 commit
  13. 13 Jul, 2015 1 commit
  14. 11 Jul, 2015 1 commit
  15. 08 Jul, 2015 1 commit
  16. 12 May, 2015 1 commit
  17. 06 Nov, 2014 1 commit
  18. 05 Nov, 2014 1 commit
  19. 01 Aug, 2014 1 commit
  20. 10 Apr, 2014 1 commit
  21. 09 Apr, 2014 1 commit
  22. 10 Dec, 2013 1 commit
  23. 26 Nov, 2013 1 commit
  24. 02 Oct, 2013 1 commit
  25. 02 Aug, 2013 1 commit
  26. 01 Aug, 2013 1 commit
  27. 17 May, 2013 1 commit
  28. 16 Apr, 2013 1 commit
  29. 18 Dec, 2012 1 commit
  30. 21 Nov, 2012 1 commit
  31. 12 Apr, 2012 1 commit
  32. 22 Mar, 2012 1 commit
  33. 21 Mar, 2012 1 commit
  34. 08 Feb, 2012 1 commit
  35. 23 Jan, 2012 1 commit
  36. 18 Nov, 2011 1 commit
  37. 07 Nov, 2011 1 commit
  38. 24 May, 2011 1 commit
  39. 28 Feb, 2011 1 commit
  40. 26 Feb, 2011 1 commit