From 0083a071f5dd7f339d0cf9692a719e146d9f377b Mon Sep 17 00:00:00 2001 From: ifilot Date: Mon, 30 Sep 2024 18:52:52 +0200 Subject: [PATCH 1/6] Bugfix testing --- .github/workflows/build_conda.yml | 2 +- meta.yaml | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_conda.yml b/.github/workflows/build_conda.yml index 29a726d..eb926dd 100644 --- a/.github/workflows/build_conda.yml +++ b/.github/workflows/build_conda.yml @@ -41,7 +41,7 @@ jobs: rm pyproject.toml conda install conda-build conda install -c ifilot pyqint pylebedev - conda install -c conda-forge tqdm + conda install -c conda-forge tqdm mendeleev conda build . --output-folder conda-bld/ - name: Archive packages uses: actions/upload-artifact@v3 diff --git a/meta.yaml b/meta.yaml index dde5191..57a89b6 100644 --- a/meta.yaml +++ b/meta.yaml @@ -22,6 +22,9 @@ requirements: - python>=3.9 - scipy - numpy + - conda-forge::mendeleev + - ifilot::pyqint + - ifilot::pylebedev test: requires: @@ -30,9 +33,13 @@ test: - scipy - conda - packaging - - python>=3.9 + - conda-forge::mendeleev + - ifilot::pyqint + - ifilot::pylebedev source_files: - tests/*.py + commands: + - pytest about: home: https://github.com/ifilot/pydft From 2c2016a5aa6e9db329f8f7343e4945ad3db987f2 Mon Sep 17 00:00:00 2001 From: ifilot Date: Mon, 30 Sep 2024 18:57:39 +0200 Subject: [PATCH 2/6] Adding pytest --- .github/workflows/build_conda.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_conda.yml b/.github/workflows/build_conda.yml index eb926dd..366a706 100644 --- a/.github/workflows/build_conda.yml +++ b/.github/workflows/build_conda.yml @@ -41,7 +41,7 @@ jobs: rm pyproject.toml conda install conda-build conda install -c ifilot pyqint pylebedev - conda install -c conda-forge tqdm mendeleev + conda install -c conda-forge tqdm mendeleev pytest conda build . --output-folder conda-bld/ - name: Archive packages uses: actions/upload-artifact@v3 @@ -56,7 +56,7 @@ jobs: runs-on: ubuntu-latest environment: name: anaconda - url: https://anaconda.org/ifilot/pyqint + url: https://anaconda.org/ifilot/pydft steps: - name: Checkout repo uses: actions/checkout@v3 From a8b3c9826199b60d62d5d0a26e94f661499011b1 Mon Sep 17 00:00:00 2001 From: ifilot Date: Mon, 30 Sep 2024 19:06:00 +0200 Subject: [PATCH 3/6] Adding conda verify --- .github/workflows/build_conda.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_conda.yml b/.github/workflows/build_conda.yml index 366a706..f9497b7 100644 --- a/.github/workflows/build_conda.yml +++ b/.github/workflows/build_conda.yml @@ -39,7 +39,7 @@ jobs: - name: Build run: | rm pyproject.toml - conda install conda-build + conda install conda-build conda-verify conda install -c ifilot pyqint pylebedev conda install -c conda-forge tqdm mendeleev pytest conda build . --output-folder conda-bld/ From c3b3b79ad0a5e72b853d4bb83db60f9d81838c77 Mon Sep 17 00:00:00 2001 From: ifilot Date: Mon, 30 Sep 2024 19:08:41 +0200 Subject: [PATCH 4/6] Fixing typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c3fc833..24af137 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![build](https://github.com/ifilot/pydft/actions/workflows/build_pypi.yml/badge.svg)](https://github.com/ifilot/pydft/actions/workflows/build_pypi.yml) [![build](https://github.com/ifilot/pydft/actions/workflows/build_conda.yml/badge.svg)](https://github.com/ifilot/pydft/actions/workflows/build_conda.yml) [![Anaconda-Server Badge](https://anaconda.org/ifilot/pydft/badges/version.svg)](https://anaconda.org/ifilot/pydft) -[![PyPI](https://img.shields.io/pypi/v/pydft?color=green)](https://pypi.org/project/pytessel/) +[![PyPI](https://img.shields.io/pypi/v/pydft?color=green)](https://pypi.org/project/pydft/) [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) > [!NOTE] From 971280d8388607aea96bee0d8d21c11c595f6694 Mon Sep 17 00:00:00 2001 From: ifilot Date: Mon, 30 Sep 2024 19:21:02 +0200 Subject: [PATCH 5/6] Refactoring tests --- tests/test_bragg_slater.py | 6 ++++++ tests/test_custom_basisset.py | 6 ++++++ tests/test_dft.py | 6 ++++++ tests/test_energy_decomposition.py | 9 ++++----- tests/test_moleculargrid.py | 10 +++++++--- tests/test_normalization.py | 6 ++++++ tests/test_version.py | 7 +++++++ tests/test_xc.py | 8 +++++++- 8 files changed, 49 insertions(+), 9 deletions(-) diff --git a/tests/test_bragg_slater.py b/tests/test_bragg_slater.py index d58119b..19ef901 100644 --- a/tests/test_bragg_slater.py +++ b/tests/test_bragg_slater.py @@ -1,5 +1,11 @@ import unittest +import sys +import os import numpy as np + +# add a reference to load the pyDFT module +sys.path.append(os.path.join(os.path.dirname(__file__), '..')) + from pydft import MoleculeBuilder, MolecularGrid class TestCustomBasisSet(unittest.TestCase): diff --git a/tests/test_custom_basisset.py b/tests/test_custom_basisset.py index 3d639e6..d692d87 100644 --- a/tests/test_custom_basisset.py +++ b/tests/test_custom_basisset.py @@ -1,5 +1,11 @@ import unittest +import sys +import os import numpy as np + +# add a reference to load the pyDFT module +sys.path.append(os.path.join(os.path.dirname(__file__), '..')) + from pydft import MoleculeBuilder, DFT from pyqint import cgf diff --git a/tests/test_dft.py b/tests/test_dft.py index 90412ce..0c48c16 100644 --- a/tests/test_dft.py +++ b/tests/test_dft.py @@ -1,5 +1,11 @@ import unittest +import sys +import os import numpy as np + +# add a reference to load the pyDFT module +sys.path.append(os.path.join(os.path.dirname(__file__), '..')) + from pydft import MoleculeBuilder, DFT class TestDFT(unittest.TestCase): diff --git a/tests/test_energy_decomposition.py b/tests/test_energy_decomposition.py index b914a5b..9503f7e 100644 --- a/tests/test_energy_decomposition.py +++ b/tests/test_energy_decomposition.py @@ -1,10 +1,9 @@ -# -*- coding: utf-8 -*- - -import numpy as np import unittest -import sys, os +import sys +import os +import numpy as np -# add a reference to load the PyPWDFT module +# add a reference to load the pyDFT module sys.path.append(os.path.join(os.path.dirname(__file__), '..')) from pydft import DFT, MoleculeBuilder diff --git a/tests/test_moleculargrid.py b/tests/test_moleculargrid.py index 0f5081f..0bd8980 100644 --- a/tests/test_moleculargrid.py +++ b/tests/test_moleculargrid.py @@ -1,8 +1,12 @@ -# -*- coding: utf-8 -*- +import unittest +import sys +import os +import numpy as np + +# add a reference to load the pyDFT module +sys.path.append(os.path.join(os.path.dirname(__file__), '..')) from pydft import MoleculeBuilder, MolecularGrid -import numpy as np -import unittest class TestMolecularGrid(unittest.TestCase): """ diff --git a/tests/test_normalization.py b/tests/test_normalization.py index 557a6b7..16f1037 100644 --- a/tests/test_normalization.py +++ b/tests/test_normalization.py @@ -1,5 +1,11 @@ import unittest +import sys +import os import numpy as np + +# add a reference to load the pyDFT module +sys.path.append(os.path.join(os.path.dirname(__file__), '..')) + from pydft import MoleculeBuilder, DFT class TestNormalization(unittest.TestCase): diff --git a/tests/test_version.py b/tests/test_version.py index a3a05be..dae4192 100644 --- a/tests/test_version.py +++ b/tests/test_version.py @@ -1,4 +1,11 @@ import unittest +import sys +import os +import numpy as np + +# add a reference to load the pyDFT module +sys.path.append(os.path.join(os.path.dirname(__file__), '..')) + import pydft class TestVersion(unittest.TestCase): diff --git a/tests/test_xc.py b/tests/test_xc.py index 93e54dc..04cbdf4 100644 --- a/tests/test_xc.py +++ b/tests/test_xc.py @@ -1,7 +1,13 @@ import unittest -from pydft import MoleculeBuilder, DFT +import sys +import os import numpy as np +# add a reference to load the pyDFT module +sys.path.append(os.path.join(os.path.dirname(__file__), '..')) + +from pydft import MoleculeBuilder, DFT + class TestXC(unittest.TestCase): def test_svwn5(self): From 86ea63c5aeebfce2573e9bbcd44c742a8fdd4835 Mon Sep 17 00:00:00 2001 From: ifilot Date: Mon, 30 Sep 2024 19:35:18 +0200 Subject: [PATCH 6/6] Adjusting packages --- meta.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/meta.yaml b/meta.yaml index 57a89b6..5ae774e 100644 --- a/meta.yaml +++ b/meta.yaml @@ -29,10 +29,9 @@ requirements: test: requires: - numpy - - nose - scipy - - conda - - packaging + - setuptools + - pytest - conda-forge::mendeleev - ifilot::pyqint - ifilot::pylebedev