Skip to content

Commit

Permalink
add SPDX ID to each file (deepmodeling#2639)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
njzjz and pre-commit-ci[bot] authored Jun 29, 2023
1 parent 94b1c11 commit 1456b45
Show file tree
Hide file tree
Showing 429 changed files with 508 additions and 33 deletions.
1 change: 1 addition & 0 deletions .license-header.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SPDX-License-Identifier: LGPL-3.0-or-later
40 changes: 40 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,45 @@ repos:
hooks:
- id: cmake-format
#- id: cmake-lint
# license header
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.1
hooks:
# C++, js
- id: insert-license
files: \.(c|cc|cpp|js|ts)$
args:
- --license-filepath
- .license-header.txt
- --comment-style
- //
- --no-extra-eol
# CSS
- id: insert-license
files: \.(css|scss)$
args:
- --license-filepath
- .license-header.txt
- --comment-style
- /*| *| */
- --no-extra-eol
# Python
- id: insert-license
files: \.(py|pyx)$
args:
- --license-filepath
- .license-header.txt
- --comment-style
- "#"
- --no-extra-eol
# HTML
- id: insert-license
files: \.(html|vue|xml)$
args:
- --license-filepath
- .license-header.txt
- --comment-style
- <!--| ~| -->
- --no-extra-eol
ci:
autoupdate_branch: devel
1 change: 1 addition & 0 deletions backend/dp_backend.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
"""A PEP-517 backend to find TensorFlow."""
from typing import (
List,
Expand Down
1 change: 1 addition & 0 deletions backend/find_tensorflow.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
import os
import site
from importlib.machinery import (
Expand Down
1 change: 1 addition & 0 deletions data/json/json2yaml.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3

# SPDX-License-Identifier: LGPL-3.0-or-later
import argparse
import json
from pathlib import (
Expand Down
1 change: 1 addition & 0 deletions data/raw/copy_raw.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3

# SPDX-License-Identifier: LGPL-3.0-or-later
import argparse
import os
import os.path
Expand Down
1 change: 1 addition & 0 deletions data/raw/shuffle_raw.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3

# SPDX-License-Identifier: LGPL-3.0-or-later
import argparse
import os

Expand Down
1 change: 1 addition & 0 deletions deepmd/__about__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
__version__ = "unknown"
1 change: 1 addition & 0 deletions deepmd/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
"""Root of the deepmd package, exposes all public classes and submodules."""

try:
Expand Down
1 change: 1 addition & 0 deletions deepmd/__main__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
"""Package dp entry point."""

from .entrypoints.main import (
Expand Down
1 change: 1 addition & 0 deletions deepmd/calculator.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
"""ASE calculator interface module."""

from pathlib import (
Expand Down
1 change: 1 addition & 0 deletions deepmd/cluster/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
"""Module that reads node resources, auto detects if running local or on SLURM."""

import os
Expand Down
1 change: 1 addition & 0 deletions deepmd/cluster/local.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
"""Get local GPU resources."""

import socket
Expand Down
1 change: 1 addition & 0 deletions deepmd/cluster/slurm.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
"""MOdule to get resources on SLURM cluster.
References
Expand Down
1 change: 1 addition & 0 deletions deepmd/common.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
"""Collection of functions and classes used throughout the whole package."""

import json
Expand Down
1 change: 1 addition & 0 deletions deepmd/descriptor/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
from .descriptor import (
Descriptor,
)
Expand Down
1 change: 1 addition & 0 deletions deepmd/descriptor/descriptor.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
from abc import (
abstractmethod,
)
Expand Down
1 change: 1 addition & 0 deletions deepmd/descriptor/hybrid.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
from typing import (
List,
Optional,
Expand Down
1 change: 1 addition & 0 deletions deepmd/descriptor/loc_frame.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
from typing import (
List,
Optional,
Expand Down
1 change: 1 addition & 0 deletions deepmd/descriptor/se.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
from typing import (
Tuple,
)
Expand Down
1 change: 1 addition & 0 deletions deepmd/descriptor/se_a.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
from typing import (
List,
Optional,
Expand Down
1 change: 1 addition & 0 deletions deepmd/descriptor/se_a_ebd.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
from typing import (
List,
Optional,
Expand Down
1 change: 1 addition & 0 deletions deepmd/descriptor/se_a_ef.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
from typing import (
List,
Optional,
Expand Down
1 change: 1 addition & 0 deletions deepmd/descriptor/se_a_mask.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
import warnings
from typing import (
Any,
Expand Down
1 change: 1 addition & 0 deletions deepmd/descriptor/se_atten.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
import logging
import warnings
from typing import (
Expand Down
1 change: 1 addition & 0 deletions deepmd/descriptor/se_r.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
from typing import (
List,
Optional,
Expand Down
1 change: 1 addition & 0 deletions deepmd/descriptor/se_t.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
from typing import (
List,
Optional,
Expand Down
1 change: 1 addition & 0 deletions deepmd/entrypoints/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
"""Submodule that contains all the DeePMD-Kit entry point scripts."""

from ..infer.model_devi import (
Expand Down
1 change: 1 addition & 0 deletions deepmd/entrypoints/compress.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
"""Compress a model, which including tabulating the embedding-net."""

import json
Expand Down
1 change: 1 addition & 0 deletions deepmd/entrypoints/convert.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
from deepmd.utils.convert import (
convert_10_to_21,
convert_012_to_21,
Expand Down
1 change: 1 addition & 0 deletions deepmd/entrypoints/doc.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
"""Module that prints train input arguments docstrings."""

from deepmd.utils.argcheck import (
Expand Down
1 change: 1 addition & 0 deletions deepmd/entrypoints/freeze.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: LGPL-3.0-or-later
"""Script for freezing TF trained graph so it can be used with LAMMPS and i-PI.
References
Expand Down
65 changes: 33 additions & 32 deletions deepmd/entrypoints/ipi.py
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
"""Use dp_ipi inside the Python package."""
import os
import subprocess
import sys
from typing import (
List,
)

from deepmd.lmp import (
get_op_dir,
)

ROOT_DIR = get_op_dir()


def _program(name: str, args: List[str]):
"""Execuate a program.
Parameters
----------
name : str
the name of the program
args : list of str
list of arguments
"""
return subprocess.call([os.path.join(ROOT_DIR, name)] + args, close_fds=False)


def dp_ipi():
"""dp_ipi."""
suffix = ".exe" if os.name == "nt" else ""
raise SystemExit(_program("dp_ipi" + suffix, sys.argv[1:]))
# SPDX-License-Identifier: LGPL-3.0-or-later
"""Use dp_ipi inside the Python package."""
import os
import subprocess
import sys
from typing import (
List,
)

from deepmd.lmp import (
get_op_dir,
)

ROOT_DIR = get_op_dir()


def _program(name: str, args: List[str]):
"""Execuate a program.
Parameters
----------
name : str
the name of the program
args : list of str
list of arguments
"""
return subprocess.call([os.path.join(ROOT_DIR, name)] + args, close_fds=False)


def dp_ipi():
"""dp_ipi."""
suffix = ".exe" if os.name == "nt" else ""
raise SystemExit(_program("dp_ipi" + suffix, sys.argv[1:]))
1 change: 1 addition & 0 deletions deepmd/entrypoints/main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
"""DeePMD-Kit entry point module."""

import argparse
Expand Down
1 change: 1 addition & 0 deletions deepmd/entrypoints/neighbor_stat.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
import logging
from typing import (
List,
Expand Down
1 change: 1 addition & 0 deletions deepmd/entrypoints/test.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
"""Test trained DeePMD model."""
import logging
from pathlib import (
Expand Down
1 change: 1 addition & 0 deletions deepmd/entrypoints/train.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
"""DeePMD training entrypoint script.
Can handle local or distributed training.
Expand Down
1 change: 1 addition & 0 deletions deepmd/entrypoints/transfer.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
"""Module used for transfering parameters between models."""

import logging
Expand Down
1 change: 1 addition & 0 deletions deepmd/env.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
"""Module that sets tensorflow working environment and exports inportant constants."""

import ctypes
Expand Down
1 change: 1 addition & 0 deletions deepmd/fit/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
from .dipole import (
DipoleFittingSeA,
)
Expand Down
1 change: 1 addition & 0 deletions deepmd/fit/dipole.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
from typing import (
List,
Optional,
Expand Down
1 change: 1 addition & 0 deletions deepmd/fit/dos.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
import logging
from typing import (
List,
Expand Down
1 change: 1 addition & 0 deletions deepmd/fit/ener.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
import logging
from typing import (
List,
Expand Down
1 change: 1 addition & 0 deletions deepmd/fit/fitting.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
from abc import (
abstractmethod,
)
Expand Down
1 change: 1 addition & 0 deletions deepmd/fit/polar.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
import warnings
from typing import (
List,
Expand Down
1 change: 1 addition & 0 deletions deepmd/infer/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
"""Submodule containing all the implemented potentials."""

from pathlib import (
Expand Down
1 change: 1 addition & 0 deletions deepmd/infer/data_modifier.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
import os
from typing import (
List,
Expand Down
1 change: 1 addition & 0 deletions deepmd/infer/deep_dipole.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
from typing import (
TYPE_CHECKING,
)
Expand Down
1 change: 1 addition & 0 deletions deepmd/infer/deep_dos.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
import logging
from typing import (
TYPE_CHECKING,
Expand Down
1 change: 1 addition & 0 deletions deepmd/infer/deep_eval.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
from functools import (
lru_cache,
)
Expand Down
1 change: 1 addition & 0 deletions deepmd/infer/deep_polar.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
from typing import (
TYPE_CHECKING,
List,
Expand Down
1 change: 1 addition & 0 deletions deepmd/infer/deep_pot.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
import logging
from typing import (
TYPE_CHECKING,
Expand Down
1 change: 1 addition & 0 deletions deepmd/infer/deep_tensor.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
from typing import (
TYPE_CHECKING,
List,
Expand Down
1 change: 1 addition & 0 deletions deepmd/infer/deep_wfc.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
from typing import (
TYPE_CHECKING,
)
Expand Down
1 change: 1 addition & 0 deletions deepmd/infer/ewald_recp.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
from typing import (
Tuple,
)
Expand Down
1 change: 1 addition & 0 deletions deepmd/infer/model_devi.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
from typing import (
Tuple,
)
Expand Down
1 change: 1 addition & 0 deletions deepmd/lmp.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
"""Register entry points for lammps-wheel."""
import os
import platform
Expand Down
1 change: 1 addition & 0 deletions deepmd/loggers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
"""Module taking care of logging duties."""

from .loggers import (
Expand Down
1 change: 1 addition & 0 deletions deepmd/loggers/loggers.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
"""Logger initialization for package."""

import logging
Expand Down
Loading

0 comments on commit 1456b45

Please sign in to comment.