Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

breaking: drop python 3.7 #783

Merged
merged 4 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ["3.7", "3.8", "3.12"]
python-version: ["3.8", "3.12"]

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Installation

DP-GEN only supports Python 3.7 and above. You can [setup a conda/pip environment](https://docs.deepmodeling.com/faq/conda.html), and then use one of the following methods to install DP-GEN:
dpdata only supports Python 3.8 and above. You can [setup a conda/pip environment](https://docs.deepmodeling.com/faq/conda.html), and then use one of the following methods to install dpdata:

- Install via pip: `pip install dpdata`
- Install via conda: `conda install -c conda-forge dpdata`
Expand Down
7 changes: 1 addition & 6 deletions docs/make_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,9 @@

import csv
import os
import sys
from collections import defaultdict
from inspect import Parameter, Signature, cleandoc, signature

if sys.version_info >= (3, 8):
from typing import Literal
else:
from typing_extensions import Literal
from typing import Literal

from numpydoc.docscrape import Parameter as numpydoc_Parameter
from numpydoc.docscrape_sphinx import SphinxDocString
Expand Down
8 changes: 4 additions & 4 deletions dpdata/stat.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,15 @@ class Errors(ErrorsBase):
SYSTEM_TYPE = LabeledSystem

@property
@lru_cache()
@lru_cache
def e_errors(self) -> np.ndarray:
"""Energy errors."""
assert isinstance(self.system_1, self.SYSTEM_TYPE)
assert isinstance(self.system_2, self.SYSTEM_TYPE)
return self.system_1["energies"] - self.system_2["energies"]

@property
@lru_cache()
@lru_cache
def f_errors(self) -> np.ndarray:
"""Force errors."""
assert isinstance(self.system_1, self.SYSTEM_TYPE)
Expand Down Expand Up @@ -153,7 +153,7 @@ class MultiErrors(ErrorsBase):
SYSTEM_TYPE = MultiSystems

@property
@lru_cache()
@lru_cache
def e_errors(self) -> np.ndarray:
"""Energy errors."""
assert isinstance(self.system_1, self.SYSTEM_TYPE)
Expand All @@ -166,7 +166,7 @@ def e_errors(self) -> np.ndarray:
return np.concatenate(errors)

@property
@lru_cache()
@lru_cache
def f_errors(self) -> np.ndarray:
"""Force errors."""
assert isinstance(self.system_1, self.SYSTEM_TYPE)
Expand Down
7 changes: 1 addition & 6 deletions dpdata/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,16 @@
import hashlib
import numbers
import os
import sys
import warnings
from copy import deepcopy
from typing import (
TYPE_CHECKING,
Any,
Iterable,
Literal,
overload,
)

if sys.version_info >= (3, 8):
from typing import Literal
else:
from typing_extensions import Literal

import numpy as np

import dpdata
Expand Down
7 changes: 1 addition & 6 deletions dpdata/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,9 @@

import io
import os
import sys
from contextlib import contextmanager
from typing import TYPE_CHECKING, Generator, overload
from typing import TYPE_CHECKING, Generator, Literal, overload

if sys.version_info >= (3, 8):
from typing import Literal
else:
from typing_extensions import Literal
import numpy as np

from dpdata.periodic_table import Element
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ authors = [
]
license = {file = "LICENSE"}
classifiers = [
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
Expand All @@ -28,7 +27,7 @@ dependencies = [
'importlib_metadata>=1.4; python_version < "3.8"',
'typing_extensions; python_version < "3.8"',
]
requires-python = ">=3.7"
requires-python = ">=3.8"
readme = "README.md"
keywords = ["lammps", "vasp", "deepmd-kit"]

Expand Down
2 changes: 1 addition & 1 deletion tests/plugin/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies = [
'dpdata',
]
readme = "README.md"
requires-python = ">=3.7"
requires-python = ">=3.8"

[project.entry-points.'dpdata.plugins']
random = "dpdata_plugin_test:ep"
Loading