From cd81995bd5c288881fdd08f627bbceb165d41971 Mon Sep 17 00:00:00 2001 From: Jan Hermann Date: Fri, 17 May 2019 11:47:16 +0200 Subject: [PATCH] add Berny.trust property --- README.md | 2 +- berny/berny.py | 7 ++++++- docs/api.rst | 6 ++++-- docs/conf.py | 1 + pyproject.toml | 2 +- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 39ebbc9..80be37d 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ In each step, it takes energy and Cartesian gradients as an input, and returns a The package implements a single optimization algorithm, which is an amalgam of several techniques, comprising the quasi-Newton method, redundant internal coordinates, an iterative Hessian approximation, a trust region scheme, and linear search. The algorithm is described in more detailed in the [documentation](https://jhrmnn.github.io/pyberny/algorithm.html). -Several desirable features are missing at the moment but planned, some of them being actively worked on (help is always welcome): [crystal geometries](https://github.com/jhrmnn/pyberny/issues/5), [coordinate constraints](https://github.com/jhrmnn/pyberny/issues/14), [coordinate weighting](https://github.com/jhrmnn/pyberny/issues/32), [transition state search](https://github.com/jhrmnn/pyberny/issues/4). +Several desirable features are missing at the moment but planned, some of them being actively worked on (help is always welcome): [crystal geometries](https://github.com/jhrmnn/pyberny/issues/5), [coordinate constraints](https://github.com/jhrmnn/pyberny/issues/14), [coordinate weighting](https://github.com/jhrmnn/pyberny/issues/32), [transition state search](https://github.com/jhrmnn/pyberny/issues/4). ## Installing diff --git a/berny/berny.py b/berny/berny.py index 659764e..df8a368 100644 --- a/berny/berny.py +++ b/berny/berny.py @@ -18,7 +18,7 @@ else: from ._py2 import Generator # noqa -__version__ = '0.2.1' +__version__ = '0.2.2' __all__ = ['Berny'] defaults = { @@ -114,6 +114,11 @@ def __next__(self): self._n += 1 return self._state.geom + @property + def trust(self): + """Current trust radius.""" + return self._state.trust + def send(self, energy_gradients): # noqa: D102 log = self._log log.n = self._n diff --git a/docs/api.rst b/docs/api.rst index 5b895cf..8676009 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -5,7 +5,9 @@ This covers all supported public API. .. module:: berny -.. autofunction:: Berny +.. autoclass:: Berny + :members: + :exclude-members: Point, send, throw .. autodata:: berny.berny.defaults @@ -16,7 +18,7 @@ This covers all supported public API. .. autofunction:: optimize .. autoclass:: Logger - :members: __call__ + :members: Geometry operations ------------------- diff --git a/docs/conf.py b/docs/conf.py index 0ddce78..36611af 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -52,6 +52,7 @@ def __getattr__(cls, name): '**': ['about.html', 'navigation.html', 'relations.html', 'searchbox.html'] } htmlhelp_basename = f'{project}doc' +autodoc_default_options = {'special-members': '__call__'} def skip_namedtuples(app, what, name, obj, skip, options): diff --git a/pyproject.toml b/pyproject.toml index 5943034..8d15d59 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ skip-string-normalization = true [tool.poetry] name = "pyberny" -version = "0.4.2" +version = "0.4.3" description = "Molecular/crystal structure optimizer" readme = "README.md" authors = ["Jan Hermann "]