diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..320358a --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,3 @@ +include *.py +recursive-include src/qmllib *.f90 +global-exclude *~ *.py[cod] *.so diff --git a/Makefile b/Makefile index 97ef22b..a27cfea 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,8 @@ all: env setup env: ${mamba} env create -f ./environment_dev.yaml -p ./env --quiet - ${pip} install -e . + ${python} -m pre_commit install + ${python} -m pip install -e . setup: ./.git/hooks/pre-commit @@ -35,10 +36,10 @@ compile: ${python} _compile.py build: - @#${python} -m build . - # ${python} -m pip wheel --no-deps -v . - ${python} -m pip wheel -v . - ls *.whl + ${python} -m build --sdist --skip-dependency-check . + @# ${python} -m pip wheel --no-deps -v . + @# ${python} -m pip wheel -v . + @#ls *.whl clean: find ./src/ -type f \ @@ -46,8 +47,10 @@ clean: -name "*.pyc" \ -name ".pyo" \ -delete + rm -rf ./src/*.egg-info/ rm -rf *.whl - rm -fr ./build/ ./__pycache__/ + rm -rf ./build/ ./__pycache__/ + rm -rf ./dist/ clean-env: rm -rf ./env/ diff --git a/README.rst b/README.rst index 1c1dfd0..04930da 100644 --- a/README.rst +++ b/README.rst @@ -9,9 +9,9 @@ building blocks to carry out efficient and accurate machine learning. As such, the goal is to provide usable and efficient implementations of concepts such as representations and kernels. -==== +============== QML or QMLLib? -==== +============== ``qmllib`` represents the core library functionality derived from the original QML package, providing a powerful toolkit for quantum machine learning @@ -19,29 +19,35 @@ applications, but without the high-level abstraction, for example SKLearn. This package is and should stay free-function design oriented. -Breaking changes from `qml`: +Breaking changes from ``qml``: - - FCHL representations callable interface to be consistent with other representations (e.i. atoms, coordinates) +* FCHL representations callable interface to be consistent with other representations (e.i. atoms, coordinates) -==== +============== How to install -==== +============== A proper pip-package is on the way, for now +.. code-block:: bash + pip install git+https://github.com/qmlcode/qmllib or if you want a specific feature branch +.. code-block:: bash + pip install git+https://github.com/qmlcode/qmllib@feature_branch -==== -How to start developing -==== +================= +How to contribute +================= Know a issue and want to get started developing? +.. code-block:: bash + git clone repo.url qmllib.git cd qmllib.git make # setup env @@ -49,35 +55,33 @@ Know a issue and want to get started developing? You know have a conda environment in `./env` and are ready to run +.. code-block:: bash + make test happy developing -==== +========== How to use -==== +========== + +.. code-block:: python raise NotImplementedError -==== +=========== How to cite -==== +=========== - raise NotImplementedError +.. code-block:: python -===== -How to contribute -===== - - * Raise issues - * Create pull requests - * Create discussions + raise NotImplementedError -===== +========= What TODO -===== +========= - * Setup ifort flags - * Setup based on FCC env variable or --global-option flags - * Find MKL from env (for example conda) - * Find what numpy has been linked too (lapack or mkl) +* Setup ifort flags +* Setup based on FCC env variable or --global-option flags +* Find MKL from env (for example conda) +* Find what numpy has been linked too (lapack or mkl) diff --git a/_compile.py b/_compile.py index dc7e7f0..01256fb 100644 --- a/_compile.py +++ b/_compile.py @@ -2,6 +2,7 @@ import os import subprocess +import sys from pathlib import Path f90_modules = { @@ -69,11 +70,13 @@ def main(): for module_name, module_sources in f90_modules.items(): path = Path(module_name) - parent = path.parent stem = path.stem + cwd = Path("src/qmllib") / parent - cmd = ["python", "-m", "numpy.f2py", "-c"] + flags + module_sources + ["-m", str(stem)] + cmd = ( + [sys.executable, "-m", "numpy.f2py", "-c"] + flags + module_sources + ["-m", str(stem)] + ) print(cwd, " ".join(cmd)) proc = subprocess.run(cmd, cwd=cwd, capture_output=True, text=True) diff --git a/environment_dev.yaml b/environment_dev.yaml index 8460817..e3031ae 100644 --- a/environment_dev.yaml +++ b/environment_dev.yaml @@ -8,12 +8,14 @@ dependencies: - monkeytype - numpy - pandas - - pyarrow - pip - pre-commit + - pyarrow - pytest - scikit-learn - scipy # build + - build - meson - ninja + - twine diff --git a/pyproject.toml b/pyproject.toml index c09eb6e..1911c7a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,23 @@ build-backend = "setuptools.build_meta" name = "qmllib" dynamic = ["version"] authors = [] -requires-python = ">=3.12" +requires-python = ">=3.8" +readme="README.rst" +description="Python/Fortran toolkit for representation of molecules and solids for machine learning of properties of molecules and solids." +classifiers = [ + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3", + "Programming Language :: Python", + "Topic :: Scientific/Engineering :: Artificial Intelligence", + "Topic :: Scientific/Engineering :: Chemistry", +] +keywords = ["qml", "quantum chemistry", "machine learning"] +dependencies=["numpy", "scipy"] + +[project.urls] +Homepage = "https://qmlcode.org" [options.packages.find] where="src" @@ -20,6 +36,5 @@ version = {attr = "qmllib.version.__version__"} [tool.setuptools.package-data] "*" = ['*.so'] - # [tool.black] # line-length = 120 diff --git a/setup.py b/setup.py index 89f0806..9f01b0f 100644 --- a/setup.py +++ b/setup.py @@ -1,14 +1,26 @@ -import sys -from pathlib import Path - from setuptools import setup try: import _compile except ImportError: + import sys + from pathlib import Path + sys.path.append(str(Path(__file__).resolve().parent)) import _compile if __name__ == "__main__": _compile.main() - setup() + setup( + description="Python/Fortran toolkit for representation of molecules and solids for machine learning of properties of molecules and solids.", + classifiers=[ + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3", + "Programming Language :: Python", + "Topic :: Scientific/Engineering :: Artificial Intelligence", + "Topic :: Scientific/Engineering :: Chemistry", + ], + keywords=["qml", "quantum chemistry", "machine learning"], + ) diff --git a/src/qmllib/version.py b/src/qmllib/version.py index 5becc17..5c4105c 100644 --- a/src/qmllib/version.py +++ b/src/qmllib/version.py @@ -1 +1 @@ -__version__ = "1.0.0" +__version__ = "1.0.1"