From c1f2ea32f8a2153ee035eeabb15510fa7b7f1cc3 Mon Sep 17 00:00:00 2001 From: Marti Municoy Date: Tue, 1 Sep 2020 21:19:22 +0200 Subject: [PATCH 1/2] General code improvements --- offpele/topology/zmatrix.py | 6 ++++++ offpele/utils/utils.py | 10 +++++++++- setup.py | 4 ++-- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/offpele/topology/zmatrix.py b/offpele/topology/zmatrix.py index cfde67d1..a572de84 100644 --- a/offpele/topology/zmatrix.py +++ b/offpele/topology/zmatrix.py @@ -45,6 +45,7 @@ def __new__(cls, molecule): return obj + @staticmethod def _extract_coords(molecule): """ It extracts the coordinates of the molecule's atoms. @@ -65,6 +66,7 @@ def _extract_coords(molecule): return coords + @staticmethod def _get_absolute_parent(molecule): """ It returns the absolute parent in the topology of the molecule. @@ -88,6 +90,7 @@ def _get_absolute_parent(molecule): return absolute_parent[0] + @staticmethod def _calculate_bond(x1, y1, z1, x2, y2, z2): """ It calculates the bond distance between two sets of coordinates. @@ -118,6 +121,7 @@ def _calculate_bond(x1, y1, z1, x2, y2, z2): return np.sqrt(dx * dx + dy * dy + dz * dz) + @staticmethod def _calculate_angle(x1, y1, z1, x2, y2, z2, x3, y3, z3): """ It calculates the angle between three sets of coordinates. @@ -172,6 +176,7 @@ def _calculate_angle(x1, y1, z1, x2, y2, z2, x3, y3, z3): return np.arccos(xang) * 180.0 / np.pi + @staticmethod def _calculate_dihedral(x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4): """ It calculates the dihedral between four sets of coordinates. @@ -246,6 +251,7 @@ def _calculate_dihedral(x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4): return phi * 180.0 / np.pi + @staticmethod def _build_zmatrix(cls, obj, coords, molecule): """ It buils the zmatrix. diff --git a/offpele/utils/utils.py b/offpele/utils/utils.py index 3978551e..62487505 100644 --- a/offpele/utils/utils.py +++ b/offpele/utils/utils.py @@ -2,6 +2,15 @@ This module contains miscellaneous set of handy classes and functions. """ + +__all__ = ["get_data_file_path", + "temporary_cd", + "warning_on_one_line", + "check_if_path_exists", + "create_path" + ] + + from pkg_resources import resource_filename import os import contextlib @@ -83,5 +92,4 @@ def create_path(path): path : str The path that will be created """ - import os os.makedirs(str(path), exist_ok=True) diff --git a/setup.py b/setup.py index 0b9b6b57..bcd85900 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ import os from os.path import relpath, join -from setuptools import setup, find_packages +from setuptools import setup import versioneer @@ -32,7 +32,7 @@ def find_package_data(data_root, package_root): 'offpele/solvent', 'offpele/topology', 'offpele/utils', - ], + ], long_description=read('README.md'), classifiers=[ "Development Status :: 1 - Planning", From 5cce518bb54d7dc8d09c36904fe6664d5eef904e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=20Municoy?= Date: Tue, 1 Sep 2020 21:39:01 +0200 Subject: [PATCH 2/2] Update releasehistory.rst --- docs/releasehistory.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/releasehistory.rst b/docs/releasehistory.rst index 794e8476..04d1f719 100644 --- a/docs/releasehistory.rst +++ b/docs/releasehistory.rst @@ -17,6 +17,7 @@ New features """""""""""" - `PR #28 `_: Adds a new method to define a `Molecule` object through a SMILES tag. This molecule can be written as a PDB file later for PELE. - `PR #31 `_: Adds the possibility to combine nonbonding and solvent parameters from OPLS2005 with bonding parameters from OFF. +- `PR #36 `_: Minor changes to improve the quality of the code. Bugfixes """"""""