1. 30 Mar, 2020 2 commits
  2. 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
  3. 19 Mar, 2020 1 commit
  4. 16 Mar, 2020 1 commit
  5. 12 Mar, 2020 1 commit
  6. 24 Feb, 2020 2 commits
  7. 18 Feb, 2020 1 commit
  8. 06 Feb, 2020 2 commits
  9. 17 Jan, 2020 2 commits
  10. 14 Jan, 2020 1 commit
  11. 03 Jan, 2020 2 commits
  12. 30 Dec, 2019 1 commit
  13. 16 Dec, 2019 2 commits
  14. 06 Dec, 2019 1 commit
  15. 03 Dec, 2019 1 commit
  16. 02 Dec, 2019 1 commit
  17. 12 Nov, 2019 1 commit
  18. 11 Nov, 2019 1 commit
  19. 05 Nov, 2019 1 commit
  20. 29 Oct, 2019 1 commit
  21. 28 Oct, 2019 1 commit
  22. 25 Oct, 2019 1 commit
  23. 23 Oct, 2019 1 commit
  24. 17 Oct, 2019 1 commit
  25. 12 Oct, 2019 1 commit
  26. 09 Oct, 2019 1 commit
  27. 07 Oct, 2019 2 commits
    • David Dotson's avatar
      Switched hartree ScaledUnit basis to joule · ad50ced2
      David Dotson authored
      From @peastman:
      
      > Test cases are failing. I believe it's because the parent for a ScaledUnit needs to be a Unit, not another ScaledUnit. So in the line
      >
      > ```
      >  hartree_base_unit = ScaledUnit(4.3597447222071e-18, joule_base_unit, "hartree", "Ha")
      > ```
      >
      > replace joule_base_unit with joule.
      ad50ced2
    • David Dotson's avatar
      Added hartree unit. · ce85b7f7
      David Dotson authored
      This is of immediate need to QCEngine, in particular MolSSI/QCEngine#151
      ce85b7f7
  28. 19 Sep, 2019 1 commit
  29. 05 Sep, 2019 1 commit
  30. 22 Aug, 2019 1 commit
  31. 21 Aug, 2019 1 commit
  32. 20 Aug, 2019 1 commit
  33. 12 Aug, 2019 1 commit