diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c70672e..e090797 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,7 @@ name: ci on: [push, pull_request] +permissions: + contents: write jobs: test: runs-on: ubuntu-latest diff --git a/tencirchem/utils/optimizer.py b/tencirchem/utils/optimizer.py index f7d03f0..6e64379 100644 --- a/tencirchem/utils/optimizer.py +++ b/tencirchem/utils/optimizer.py @@ -9,6 +9,32 @@ def soap(fun, x0, args=(), maxfev=2000, callback=None, **kwargs): + """ + Scipy Optimizer interface for sequantial optimization with + approximate parabola (SOAP) + + Parameters + ---------- + fun : callable ``f(x, *args)`` + Function to be optimized. + x0 : ndarray, shape (n,) + Initial guess. Array of real elements of size (n,), + where 'n' is the number of independent variables. + args : tuple, optional + Extra arguments passed to the objective function. + maxfev : int + Maximum number of function evaluations to perform. + Default: 2000. + callback : callable, optional + Called after each iteration. + + Returns + ------- + res : OptimizeResult + The optimization result represented as a SciPy ``OptimizeResult`` object. + Important attributes are: ``x`` the solution array. + """ + nfev = 0 nit = 0