diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml new file mode 100644 index 00000000..98bab6b7 --- /dev/null +++ b/.github/workflows/pytest.yaml @@ -0,0 +1,45 @@ +name: pytest + +on: + push: + branches: + - master + tags-ignore: + - '**' + pull_request: + +jobs: + tests: + name: "Python ${{ matrix.py }} on OS ${{ matrix.os }}" + runs-on: ${{ matrix.os }} + env: + working-directory: . + + strategy: + matrix: + os: ["ubuntu-latest", "windows-latest"] + py: ["3.7", "3.9", "3.10", "3.11"] + + steps: + - uses: "actions/checkout@v3" + + - name: Setup python for test ${{ matrix.py }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.py }} + + - name: Install dependencies for testing + run: | + pip install --upgrade pip + pip install pytest pytest-md pytest-emoji pytest-cov + pip install git+https://github.com/theochem/gbasis.git@master + pip install git+https://github.com/theochem/grid.git@master + pip install git+https://github.com/theochem/iodata.git@master + + - name: Install development version + run: | + pip install . + + - name: Run pytest + run: | + pytest \ No newline at end of file diff --git a/MANIFEST.in b/MANIFEST.in index 25724086..9d34850c 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,4 @@ include LICENSE include README.rst -include atomdb/datasets/*/data/* -include atomdb/datasets/*/raw_data/* +include atomdb/datasets/*/db/* diff --git a/atomdb/__init__.py b/atomdb/__init__.py index 92bb2aed..a3f4395b 100644 --- a/atomdb/__init__.py +++ b/atomdb/__init__.py @@ -24,6 +24,7 @@ from atomdb.promolecule import * +from atomdb.datasets import * __version__ = version r"""AtomDB version string.""" diff --git a/atomdb/datasets/__init__.py b/atomdb/datasets/__init__.py index 4146fdae..2f29d4cf 100644 --- a/atomdb/datasets/__init__.py +++ b/atomdb/datasets/__init__.py @@ -12,3 +12,9 @@ # # You should have received a copy of the GNU General Public License # along with AtomDB. If not, see . +from .gaussian import * +from .hci_augccpwcvqz import * +from .nist import * +from .numeric import * +from .slater import * +from atomdb.datasets.numeric import * diff --git a/atomdb/test/test_gaussian.py b/atomdb/test/test_gaussian.py index f7b52eac..07fac19b 100644 --- a/atomdb/test/test_gaussian.py +++ b/atomdb/test/test_gaussian.py @@ -25,6 +25,7 @@ import numpy as np from numpy.testing import assert_equal, assert_almost_equal from atomdb.api import load +import atomdb.datasets TEST_DATAPATH = "atomdb/test/data/" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..1387e100 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,94 @@ +# This file is part of AtomDB. +# +# AtomDB is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free +# Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# AtomDB is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License +# along with AtomDB. If not, see . + +[build-system] +requires = ["setuptools>=65.0", "setuptools_scm[toml]>=7.1.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "AtomDB" +authors = [ + { name="QC-Devs Community", email="qcdevs@gmail.com" }, +] +description = "AtomDB is a database of atomic and ionic properties." +readme = "README.rst" +license = {text = "GPL-3.0-or-later"} +requires-python = ">=3.7" +classifiers = [ + 'Development Status :: 0 - Released', + 'Environment :: Console', + 'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)', + 'Operating System :: POSIX :: Linux', + 'Topic :: Scientific/Engineering :: Physics', + 'Topic :: Scientific/Engineering :: Chemistry', + 'Intended Audience :: Science/Research', + "Intended Audience :: Education", + "Natural Language :: English", + 'Programming Language :: Python :: 3.7', + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", +] +dependencies = [ + "numpy>=1.16", + "pytest >=2.6", + "scipy>=1.4", + "msgpack", + "h5py", +] +dynamic = ["version"] + +[project.urls] +Documentation = "https://atomdb.qcdevs.org" +Issues = "https://github.com/theochem/atomdb/issues" +Source = "https://github.com/theochem/atomdb/" +Changelog = "https://github.com/theochem/atomdb/blob/main/CHANGELOG.md" + +[project.optional-dependencies] +doc = [ + "ipython", + "numpydoc", + "sphinx_copybutton", + "sphinx-autoapi", + "nbsphinx", + "nbconvert", + "sphinx_rtd_theme", + "sphinx_autodoc_typehints", + "docutils==0.16", # Needed to show bullet points in sphinx_rtd_theme + "nbsphinx-link" +] + +[tool.black] +line-length = 100 + +[tool.ruff] +# E is pycodestyle +# F is pyflakes +# UP is pyupgrade - automatically updates syntax +# B is flake8-bugbear +# I is sort imports alphabetically +# PGH is pygrep-hooks +# PL is pylint +# RUF is Ruff-specific rules +select = ["E", "F", "UP", "B", "I", "PGH", "PL", "RUF"] +line-length = 100 +ignore = ["PLR2004", "PLR0913", "PLR0912", "PLW2901", "PLR0915", "RUF013"] +extend-exclude = ["doc/*", "doc/*/*"] + +[tool.pytest.ini_options] +minversion = "7.0" +testpaths = ["tests"] +addopts = "-v" \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 5993d971..00000000 --- a/setup.py +++ /dev/null @@ -1,34 +0,0 @@ -# This file is part of AtomDB. -# -# AtomDB is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free -# Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# AtomDB is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# for more details. -# -# You should have received a copy of the GNU General Public License -# along with AtomDB. If not, see . - -r"""AtomDB setup script. Run `python setup.py --help` for help.""" - - -from setuptools import setup - - -if __name__ == '__main__': - - README = open('README.rst', 'r').read() - - setup( - name='atomdb', - description='AtomDB', - long_description=README, - packages=['atomdb'], - package_dir={'atomdb': 'atomdb'}, - include_package_data=True, - install_requires=["numpy", "scipy", "msgpack", "h5py"] - )