diff --git a/backend/find_tensorflow.py b/backend/find_tensorflow.py index 08a73f7252..32ae62469c 100644 --- a/backend/find_tensorflow.py +++ b/backend/find_tensorflow.py @@ -28,7 +28,7 @@ ) -@lru_cache() +@lru_cache def find_tensorflow() -> Tuple[Optional[str], List[str]]: """Find TensorFlow library. @@ -111,7 +111,7 @@ def find_tensorflow() -> Tuple[Optional[str], List[str]]: return tf_install_dir, requires -@lru_cache() +@lru_cache def get_tf_requirement(tf_version: str = "") -> dict: """Get TensorFlow requirement (CPU) when TF is not installed. @@ -189,7 +189,7 @@ def get_tf_requirement(tf_version: str = "") -> dict: } -@lru_cache() +@lru_cache def get_tf_version(tf_path: Union[str, Path]) -> str: """Get TF version from a TF Python library path. diff --git a/backend/read_env.py b/backend/read_env.py index ba6bf5f9f3..2cf433181a 100644 --- a/backend/read_env.py +++ b/backend/read_env.py @@ -19,7 +19,7 @@ ) -@lru_cache() +@lru_cache def get_argument_from_env() -> Tuple[str, list, list, dict, str]: """Get the arguments from environment variables. diff --git a/deepmd/tf/utils/tabulate.py b/deepmd/tf/utils/tabulate.py index 4ade5962e0..ff5e2b9e09 100644 --- a/deepmd/tf/utils/tabulate.py +++ b/deepmd/tf/utils/tabulate.py @@ -770,12 +770,12 @@ def _get_layer_size(self): return layer_size @property - @lru_cache() + @lru_cache def _n_all_excluded(self) -> int: """Then number of types excluding all types.""" return sum(int(self._all_excluded(ii)) for ii in range(0, self.ntypes)) - @lru_cache() + @lru_cache def _all_excluded(self, ii: int) -> bool: """Check if type ii excluds all types. diff --git a/doc/development/coding-conventions.rst b/doc/development/coding-conventions.rst index ad4203ee4f..137b0d0d51 100644 --- a/doc/development/coding-conventions.rst +++ b/doc/development/coding-conventions.rst @@ -30,7 +30,7 @@ Rules ----- The code must be compatible with the oldest supported version of python -which is 3.7 +which is 3.8. The project follows the generic coding conventions as specified in the `Style Guide for Python Code`_, `Docstring diff --git a/doc/install/easy-install.md b/doc/install/easy-install.md index 3bc1f4b944..2d0972c8be 100644 --- a/doc/install/easy-install.md +++ b/doc/install/easy-install.md @@ -8,6 +8,10 @@ After your easy installation, DeePMD-kit (`dp`) and LAMMPS (`lmp`) will be avail Note: The off-line packages and conda packages require the [GNU C Library](https://www.gnu.org/software/libc/) 2.17 or above. The GPU version requires [compatible NVIDIA driver](https://docs.nvidia.com/deploy/cuda-compatibility/index.html#minor-version-compatibility) to be installed in advance. It is possible to force conda to [override detection](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-virtual.html#overriding-detected-packages) when installation, but these requirements are still necessary during runtime. ::: +:::{note} +Python 3.8 or above is required for Python interface. +::: + - [Install off-line packages](#install-off-line-packages) - [Install with conda](#install-with-conda) - [Install with docker](#install-with-docker) diff --git a/doc/install/install-from-source.md b/doc/install/install-from-source.md index 4f94b9c793..51d1f4c1e5 100644 --- a/doc/install/install-from-source.md +++ b/doc/install/install-from-source.md @@ -16,12 +16,13 @@ deepmd_source_dir=`pwd` ## Install the python interface ### Install Tensorflow's python interface -First, check the python version on your machine +First, check the python version on your machine. +Python 3.8 or above is required. ```bash python --version ``` -We follow the virtual environment approach to install TensorFlow's Python interface. The full instruction can be found on the official [TensorFlow website](https://www.tensorflow.org/install/pip). TensorFlow 1.8 or later is supported. Now we assume that the Python interface will be installed to the virtual environment directory `$tensorflow_venv` +We follow the virtual environment approach to install TensorFlow's Python interface. The full instruction can be found on the official [TensorFlow website](https://www.tensorflow.org/install/pip). TensorFlow 2.2 or later is supported. Now we assume that the Python interface will be installed to the virtual environment directory `$tensorflow_venv` ```bash virtualenv -p python3 $tensorflow_venv source $tensorflow_venv/bin/activate diff --git a/pyproject.toml b/pyproject.toml index 8b8da65aaf..6c8632ddb9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,7 +27,7 @@ classifiers = [ "Programming Language :: Python :: 3 :: Only", "Environment :: GPU :: NVIDIA CUDA :: 12 :: 12.2", "Intended Audience :: Science/Research", - "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)", "Topic :: Scientific/Engineering :: Artificial Intelligence", "Topic :: Scientific/Engineering :: Physics", @@ -46,7 +46,7 @@ dependencies = [ 'wcmatch', 'packaging', ] -requires-python = ">=3.7" +requires-python = ">=3.8" keywords = ["deepmd"] [project.entry-points."lammps.plugins"] diff --git a/source/install/build_tf.py b/source/install/build_tf.py index 15847d2c21..3e3700b9ac 100755 --- a/source/install/build_tf.py +++ b/source/install/build_tf.py @@ -423,14 +423,14 @@ def __init__(self, version="1.11.0") -> None: self.version = version @property - @lru_cache() + @lru_cache def resources(self) -> Dict[str, OnlineResource]: return { "bazelisk": RESOURCES["bazelisk-" + self.version], } @property - @lru_cache() + @lru_cache def dependencies(self) -> Dict[str, Build]: return {} @@ -449,12 +449,12 @@ class BuildNumpy(Build): """Build NumPy.""" @property - @lru_cache() + @lru_cache def resources(self) -> Dict[str, OnlineResource]: return {} @property - @lru_cache() + @lru_cache def dependencies(self) -> Dict[str, Build]: return {} @@ -481,12 +481,12 @@ class BuildCUDA(Build): """Find CUDA.""" @property - @lru_cache() + @lru_cache def resources(self) -> Dict[str, OnlineResource]: return {} @property - @lru_cache() + @lru_cache def dependencies(self) -> Dict[str, Build]: return {} @@ -536,7 +536,7 @@ def cudnn_version(self): ) @property - @lru_cache() + @lru_cache def cuda_compute_capabilities(self): """Get cuda compute capabilities.""" cuda_version = tuple(map(int, self.cuda_version.split("."))) @@ -554,12 +554,12 @@ class BuildROCM(Build): """Find ROCm.""" @property - @lru_cache() + @lru_cache def resources(self) -> Dict[str, OnlineResource]: return {} @property - @lru_cache() + @lru_cache def dependencies(self) -> Dict[str, Build]: return {} @@ -599,14 +599,14 @@ def __init__( self.enable_rocm = enable_rocm @property - @lru_cache() + @lru_cache def resources(self) -> Dict[str, OnlineResource]: return { "tensorflow": RESOURCES["tensorflow-" + self.version], } @property - @lru_cache() + @lru_cache def dependencies(self) -> Dict[str, Build]: optional_dep = {} if self.enable_cuda: