diff --git a/poetry.lock b/poetry.lock index 9ac1435f..f6e8b378 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2125,8 +2125,8 @@ files = [ [package.dependencies] numpy = [ {version = ">=1.22.4", markers = "python_version < \"3.11\""}, - {version = ">=1.26.0", markers = "python_version >= \"3.12\""}, {version = ">=1.23.2", markers = "python_version == \"3.11\""}, + {version = ">=1.26.0", markers = "python_version >= \"3.12\""}, ] python-dateutil = ">=2.8.2" pytz = ">=2020.1" @@ -2480,8 +2480,8 @@ astroid = ">=3.2.0,<=3.3.0-dev0" colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} dill = [ {version = ">=0.2", markers = "python_version < \"3.11\""}, + {version = ">=0.3.6", markers = "python_version >= \"3.11\""}, {version = ">=0.3.7", markers = "python_version >= \"3.12\""}, - {version = ">=0.3.6", markers = "python_version >= \"3.11\" and python_version < \"3.12\""}, ] isort = ">=4.2.5,<5.13.0 || >5.13.0,<6" mccabe = ">=0.6,<0.8" @@ -2647,7 +2647,6 @@ files = [ {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, - {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, diff --git a/src/py4vasp/calculation/__init__.py b/src/py4vasp/calculation/__init__.py index 75a08478..17a4ae34 100644 --- a/src/py4vasp/calculation/__init__.py +++ b/src/py4vasp/calculation/__init__.py @@ -79,7 +79,7 @@ class provides a more flexible interface with which you can determine the source "workfunction", ) _private = ("dispersion",) -__all__ = _quantities + _input_files +__all__ = _quantities # + _input_files path = pathlib.Path(".") @@ -90,9 +90,9 @@ def __getattr__(attr): module = importlib.import_module(f"py4vasp.calculation._{attr}") class_ = getattr(module, convert.to_camelcase(attr)) return class_.from_path(".") - elif attr in (_input_files): - class_ = getattr(control, attr) - return class_(".") + # elif attr in (_input_files): + # class_ = getattr(control, attr) + # return class_(".") else: message = f"Could not find {attr} in the possible attributes, please check the spelling" raise exception.MissingAttribute(message) diff --git a/src/py4vasp/calculation/_class.py b/src/py4vasp/calculation/_class.py index c0e4e3dc..041a9253 100644 --- a/src/py4vasp/calculation/_class.py +++ b/src/py4vasp/calculation/_class.py @@ -94,32 +94,33 @@ def path(self): "Return the path in which the calculation is run." return self._path - @property - def INCAR(self): - "The INCAR file of the VASP calculation." - return self._INCAR - - @INCAR.setter - def INCAR(self, incar): - self._INCAR.write(str(incar)) - - @property - def KPOINTS(self): - "The KPOINTS file of the VASP calculation." - return self._KPOINTS - - @KPOINTS.setter - def KPOINTS(self, kpoints): - self._KPOINTS.write(str(kpoints)) - - @property - def POSCAR(self): - "The POSCAR file of the VASP calculation." - return self._POSCAR - - @POSCAR.setter - def POSCAR(self, poscar): - self._POSCAR.write(str(poscar)) + # Input files are not in current release + # @property + # def INCAR(self): + # "The INCAR file of the VASP calculation." + # return self._INCAR + # + # @INCAR.setter + # def INCAR(self, incar): + # self._INCAR.write(str(incar)) + # + # @property + # def KPOINTS(self): + # "The KPOINTS file of the VASP calculation." + # return self._KPOINTS + # + # @KPOINTS.setter + # def KPOINTS(self, kpoints): + # self._KPOINTS.write(str(kpoints)) + # + # @property + # def POSCAR(self): + # "The POSCAR file of the VASP calculation." + # return self._POSCAR + # + # @POSCAR.setter + # def POSCAR(self, poscar): + # self._POSCAR.write(str(poscar)) def _add_all_refinement_classes(calc, add_single_class): @@ -155,6 +156,8 @@ def _add_to_documentation(calc, name): def _add_input_files(calc): + return calc + # Input files are not in current release for name in calculation._input_files: file_ = getattr(control, name)(calc.path()) setattr(calc, f"_{name}", file_) diff --git a/tests/calculation/test_class.py b/tests/calculation/test_class.py index 501aa89f..441ffbce 100644 --- a/tests/calculation/test_class.py +++ b/tests/calculation/test_class.py @@ -51,6 +51,7 @@ def test_all_attributes(mock_access): mock_access.return_value.__enter__.assert_not_called() +@pytest.mark.skip("Input files are not included in current release.") def test_input_files_from_path(): with patch("py4vasp._control.base.InputFile.__init__", return_value=None) as mock: calculation = Calculation.from_path("test_path") @@ -59,6 +60,7 @@ def test_input_files_from_path(): check_all_input_files(calculation) +@pytest.mark.skip("Input files are not included in current release.") def test_input_files_from_file(): with patch("py4vasp._control.base.InputFile.__init__", return_value=None) as mock: calculation = Calculation.from_file("test_file") diff --git a/tests/conftest.py b/tests/conftest.py index e7e96906..da06f97f 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -712,7 +712,8 @@ def _partial_charge(selection): else: spin_dimension = 1 grid = raw.VaspData(tuple(reversed(grid_dim))) - gaussian_charge = np.zeros((len(kpoints), len(bands), spin_dimension, *grid_dim)) + charge_shape = (len(kpoints), len(bands), spin_dimension, *grid_dim) + gaussian_charge = np.zeros(charge_shape) if not _is_core(): cov = grid_dim[0] / 10 # standard deviation z = np.arange(grid_dim[0]) # z range