Skip to content

Commit

Permalink
Fixes bug in effective mass calculation (#98)
Browse files Browse the repository at this point in the history
* Fixed broken links

* Added description to conda recipe

* Buf fix
  • Loading branch information
Charlles Abreu authored May 1, 2024
1 parent f301e58 commit 9dea73c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ different states and to identify pathways connecting them.

CVPack is a Python package that provides pre-defined CVs for the powerful molecular dynamics engine
[OpenMM]. All these CVs are subclasses of OpenMM's [Force] class and, as such, can be directly added
to a [CustomCVForce] or used to define a [BiasVariable] for [Metadynamics], for instance.
to a [CustomCVForce] or used to define a [BiasVariable] for [Metadynamics].

Collective Variables
--------------------
Expand Down Expand Up @@ -98,17 +98,17 @@ Copyright
Copyright (c) 2023-2024 [C. Abreu](https://github.com/craabreu) & [Redesign Science](https://www.redesignscience.com)


Acknowledgements
----------------
Acknowledgments
---------------

Initial project based on the [CMS Cookiecutter] version 1.1.

[BiasVariable]: https://docs.openmm.org/latest/api-python/generated/openmm.app.metadynamics.BiasVariable.html
[BiasVariable]: http://docs.openmm.org/latest/api-python/generated/openmm.app.metadynamics.BiasVariable.html
[CMS Cookiecutter]: https://github.com/molssi/cookiecutter-cms
[CustomCVForce]: https://docs.openmm.org/latest/api-python/generated/openmm.openmm.CustomCVForce.html
[Force]: https://docs.openmm.org/latest/api-python/generated/openmm.openmm.Force.html
[Metadynamics]: https://docs.openmm.org/latest/api-python/generated/openmm.app.metadynamics.Metadynamics.html
[OpenMM]: https://openmm.org
[CustomCVForce]: http://docs.openmm.org/latest/api-python/generated/openmm.openmm.CustomCVForce.html
[Force]: http://docs.openmm.org/latest/api-python/generated/openmm.openmm.Force.html
[Metadynamics]: http://docs.openmm.org/latest/api-python/generated/openmm.app.metadynamics.Metadynamics.html
[OpenMM]: http://openmm.org

[Angle]: https://redesignscience.github.io/cvpack/latest/api/Angle.html
[Atomic Function]: https://redesignscience.github.io/cvpack/latest/api/AtomicFunction.html
Expand Down
2 changes: 1 addition & 1 deletion cvpack/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def compute_effective_mass(
squared_forces = np.sum(np.square(force_vectors), axis=1)
nonzeros = np.nonzero(squared_forces)[0]
if nonzeros.size == 0:
return mmunit.Quantity(np.inf, force._mass_unit)
return np.inf
mass_values = np.fromiter(map(get_mass, nonzeros), dtype=np.float64)
return 1.0 / np.sum(squared_forces[nonzeros] / mass_values)

Expand Down
2 changes: 1 addition & 1 deletion devtools/conda-recipes/anaconda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ test:
about:
home: https://github.com/RedesignScience/cvpack
summary: Useful Collective Variables for OpenMM
description: Useful Collective Variables for OpenMM
license: MIT
license_family: MIT
license_file: LICENSE
doc_url: https://redesignscience.github.io/cvpack/latest
dev_url: https://github.com/RedesignScience/cvpack

extra:
recipe-maintainers:
- craabreu
16 changes: 8 additions & 8 deletions docs/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ The output should be::
The output shows that the normalized helix content of residues LYS60-ARG80 of the T4 lysozyme L99A
molecule is close to one, as expected, no matter which measure is used.

.. _BiasVariable: https://docs.openmm.org/latest/api-python/generated/openmm.app.metadynamics.BiasVariable.html
.. _CollectiveVariable: https://ufedmm.readthedocs.io/en/latest/pythonapi/ufedmm.html#ufedmm.ufedmm.CollectiveVariable
.. _Context: https://docs.openmm.org/latest/api-python/generated/openmm.openmm.Context.html
.. _CustomCVForce: https://docs.openmm.org/latest/api-python/generated/openmm.openmm.CustomCVForce.html
.. _Force: https://docs.openmm.org/latest/api-python/generated/openmm.openmm.Force.html
.. _Metadynamics: https://docs.openmm.org/latest/api-python/generated/openmm.app.metadynamics.Metadynamics.html
.. _OpenMM: https://openmm.org
.. _BiasVariable: http://docs.openmm.org/latest/api-python/generated/openmm.app.metadynamics.BiasVariable.html
.. _CollectiveVariable: https://craabreu.github.io/ufedmm/pythonapi/ufedmm.html#ufedmm.ufedmm.CollectiveVariable
.. _Context: http://docs.openmm.org/latest/api-python/generated/openmm.openmm.Context.html
.. _CustomCVForce: http://docs.openmm.org/latest/api-python/generated/openmm.openmm.CustomCVForce.html
.. _Force: http://docs.openmm.org/latest/api-python/generated/openmm.openmm.Force.html
.. _Metadynamics: http://docs.openmm.org/latest/api-python/generated/openmm.app.metadynamics.Metadynamics.html
.. _OpenMM: http://openmm.org
.. _OpenMMTools: https://openmmtools.readthedocs.io/en/stable
.. _UFED: https://ufedmm.readthedocs.io/en/latest/index.html
.. _UFED: https://craabreu.github.io/ufedmm/

0 comments on commit 9dea73c

Please sign in to comment.