diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0b1a74ac27156d703ce83a93559bffca619c2838..98f56a24d7494d5da51077686b67fbcc3eb25a8a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,7 +5,7 @@ stages: variables: PYLINT_CMD: > - (pylint grext --exit-zero > pylint.out) || true + (pylint gext --exit-zero > pylint.out) || true PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" default: @@ -35,7 +35,7 @@ lint: stage: lint script: - mkdir -p ./public - - pylint grext --exit-zero | tee pylint.out + - pylint gext --exit-zero | tee pylint.out - score=$(sed -n 's/^Your code has been rated at \([-0-9.]*\)\/.*/\1/p' pylint.out) - echo "Pylint score was $score" - anybadge --value=$score --file=public/pylint_badge.svg pylint diff --git a/README.md b/README.md index 77532e99d3fb2c4b5ba043272d9f20dcf9710159..67fb2ae18806fb0fb97ef154603082e28b451107 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ - - - + + + -# grext: Grassmann Extrapolation Library +# gext: Grassmann Extrapolation Library This library define an `Extrapolator` class to be used for providing guesses in QM simulations. It is designed in such a way that requires minimum modifications on the QM code side. @@ -15,10 +15,10 @@ The library can be installed using `pip`: ## Usage The usage requires only four lines of code: - - Add an import statement `import grext`. + - Add an import statement `import gext`. - Initialize a new extrapolator by inserting the line: - `extrapolator = grext.Extrapolator(nelectrons, nbasis, natoms)`. + `extrapolator = gext.Extrapolator(nelectrons, nbasis, natoms)`. **Note:** the extrapolator can be finely controlled by passing additional keyword arguments. This is explained in the next section. - When a new SCF calculation has been performed, load the resulting data in the extrapolator by running: @@ -39,7 +39,7 @@ The usage requires only four lines of code: ## Further options The behavior can be finely controlled by passing additional keyword arguments to the -`grext.Extrapolator()` constructor. **Note: many options are not yet implemented.** +`gext.Extrapolator()` constructor. **Note: many options are not yet implemented.** This is an up to date list of available keyword options: diff --git a/grext/__init__.py b/gext/__init__.py similarity index 56% rename from grext/__init__.py rename to gext/__init__.py index 06beea203a16a212929a635132b103515163ccdb..c0b8298b47dd977a724538aa9bc9e36ad3070aff 100644 --- a/grext/__init__.py +++ b/gext/__init__.py @@ -1,4 +1,4 @@ -"""The package grext provides tools for generating new guesses for the +"""The package gext provides tools for generating new guesses for the self consistent field in molecular dynamics simulations.""" from .main import Extrapolator diff --git a/grext/buffer.py b/gext/buffer.py similarity index 100% rename from grext/buffer.py rename to gext/buffer.py diff --git a/grext/descriptors.py b/gext/descriptors.py similarity index 100% rename from grext/descriptors.py rename to gext/descriptors.py diff --git a/grext/fitting.py b/gext/fitting.py similarity index 100% rename from grext/fitting.py rename to gext/fitting.py diff --git a/grext/grassmann.py b/gext/grassmann.py similarity index 100% rename from grext/grassmann.py rename to gext/grassmann.py diff --git a/grext/main.py b/gext/main.py similarity index 100% rename from grext/main.py rename to gext/main.py diff --git a/setup.py b/setup.py index 718abde3dc14d06fe090e5c7b63793fe3288c47a..aa7212ab0a1abae65d26e2d0ffe825a0efbd03fd 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup, find_packages setup( - name="grext", + name="gext", version="0.5.0", packages=find_packages(), install_requires=["numpy", "scipy"], diff --git a/tests/test_buffer.py b/tests/test_buffer.py index 659c5bd945197c2cc8f2712406d2f2823841bb4a..81f495daf62446c2400c258125d2f66c203ff0c4 100644 --- a/tests/test_buffer.py +++ b/tests/test_buffer.py @@ -4,7 +4,7 @@ import sys import numpy as np sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) -from grext.buffer import CircularBuffer +from gext.buffer import CircularBuffer def test_buffer(): diff --git a/tests/test_descriptor_fitting.py b/tests/test_descriptor_fitting.py index c673bceb5d970f3e5ef45d0d07f2ad11cf5e62ac..e7d84b3a866bb2a8ac12fbaf506465f2d6aedffd 100644 --- a/tests/test_descriptor_fitting.py +++ b/tests/test_descriptor_fitting.py @@ -4,10 +4,10 @@ import sys import numpy as np sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) -import grext -import grext.descriptors -import grext.fitting -import grext.grassmann +import gext +import gext.descriptors +import gext.fitting +import gext.grassmann import utils SMALL = 1e-10 @@ -23,7 +23,7 @@ def test_descriptor_fitting(datafile): nframes = data["trajectory"].shape[0] # initialize an extrapolator - extrapolator = grext.Extrapolator(nelectrons, nbasis, natoms, nframes) + extrapolator = gext.Extrapolator(nelectrons, nbasis, natoms, nframes) # load data in the extrapolator for (coords, coeff, overlap) in zip(data["trajectory"], @@ -37,8 +37,8 @@ def test_descriptor_fitting(datafile): for start in range(0, 9): vectors = descriptors[start:-1] - fit_coefficients = grext.fitting.linear(vectors, target) - fitted_target = grext.fitting.linear_combination(vectors, fit_coefficients) + fit_coefficients = gext.fitting.linear(vectors, target) + fitted_target = gext.fitting.linear_combination(vectors, fit_coefficients) errors.append(np.linalg.norm(target - fitted_target, ord=np.inf)) assert errors[0] < errors[-1] @@ -47,7 +47,7 @@ def test_descriptor_fitting(datafile): # used for the fitting vectors = descriptors[:-1] vectors[0] = target - fit_coefficients = grext.fitting.linear(vectors, target) - fitted_target = grext.fitting.linear_combination(vectors, fit_coefficients) + fit_coefficients = gext.fitting.linear(vectors, target) + fitted_target = gext.fitting.linear_combination(vectors, fit_coefficients) assert np.linalg.norm(target - fitted_target, ord=np.inf) < SMALL diff --git a/tests/test_extrapolation.py b/tests/test_extrapolation.py index 5fcb992a4d9986ac31826d77746a192203bf8054..69914ef676b19e68880bfb000651901f92d5b603 100644 --- a/tests/test_extrapolation.py +++ b/tests/test_extrapolation.py @@ -4,8 +4,8 @@ import sys import numpy as np sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) -import grext -import grext.grassmann +import gext +import gext.grassmann import utils SMALL = 1e-10 @@ -26,7 +26,7 @@ def test_extrapolation(datafile): assert n < nframes # initialize an extrapolator - extrapolator = grext.Extrapolator(nelectrons, nbasis, natoms, n) + extrapolator = gext.Extrapolator(nelectrons, nbasis, natoms, n) # load data in the extrapolator up to index n - 1 for (coords, coeff, overlap) in zip(data["trajectory"][:n], diff --git a/tests/test_grassmann.py b/tests/test_grassmann.py index 1602bffc7f71e71a939129283d9ce1daf4c01711..04d3fb9cf63fa1a937b614334174de0e66fd1d06 100644 --- a/tests/test_grassmann.py +++ b/tests/test_grassmann.py @@ -4,8 +4,8 @@ import sys import numpy as np sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) -import grext -import grext.grassmann +import gext +import gext.grassmann import utils SMALL = 1e-10 @@ -21,7 +21,7 @@ def test_grassmann(datafile): nframes = data["trajectory"].shape[0] # initialize an extrapolator - extrapolator = grext.Extrapolator(nelectrons, nbasis, natoms, nframes) + extrapolator = gext.Extrapolator(nelectrons, nbasis, natoms, nframes) # load data in the extrapolator for (coords, coeff, overlap) in zip(data["trajectory"], @@ -44,7 +44,7 @@ def test_grassmann(datafile): assert np.trace(d) - nelectrons < SMALL # compute the density from the inverse Grassmann map: Exp(Log(D)) - coeff_1 = grext.grassmann.exp(gamma, c0) + coeff_1 = gext.grassmann.exp(gamma, c0) d_1 = coeff_1 @ coeff_1.T # standard check on the second density