Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 26, 2024
1 parent 769284a commit 1cfb432
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 41 deletions.
5 changes: 2 additions & 3 deletions source/tests/pt/test_LKF.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
import json
import os
import unittest
from pathlib import (
Path,
Expand All @@ -8,9 +10,6 @@
main,
)

import json
import os


class TestLKF(unittest.TestCase):
def test_lkf(self):
Expand Down
8 changes: 4 additions & 4 deletions source/tests/pt/test_descriptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
tf.disable_eager_execution()

import json
from pathlib import (
Path,
)

from deepmd.pt.model.descriptor import (
prod_env_mat_se_a,
Expand All @@ -22,17 +25,14 @@
from deepmd.pt.utils.env import (
DEVICE,
GLOBAL_NP_FLOAT_PRECISION,
GLOBAL_PT_FLOAT_PRECISION
GLOBAL_PT_FLOAT_PRECISION,
)
from deepmd.tf.common import (
expand_sys_str,
)
from deepmd.tf.env import (
op_module,
)
from pathlib import (
Path,
)

CUR_DIR = os.path.dirname(__file__)

Expand Down
10 changes: 5 additions & 5 deletions source/tests/pt/test_embedding_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@

tf.disable_eager_execution()

from pathlib import (
Path,
)

from deepmd.pt.model.descriptor import (
DescrptSeA,
)
Expand All @@ -21,17 +25,13 @@
)
from deepmd.pt.utils.env import (
DEVICE,
GLOBAL_NP_FLOAT_PRECISION
GLOBAL_NP_FLOAT_PRECISION,
)
from deepmd.tf.common import (
expand_sys_str,
)
from deepmd.tf.descriptor import DescrptSeA as DescrptSeA_tf

from pathlib import (
Path,
)

CUR_DIR = os.path.dirname(__file__)


Expand Down
7 changes: 4 additions & 3 deletions source/tests/pt/test_force_grad.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
import copy
import json
import unittest
from pathlib import (
Path,
)
from typing import (
List,
Optional,
Expand All @@ -25,9 +28,7 @@
from deepmd.pt.utils.stat import (
make_stat_input,
)
from pathlib import (
Path,
)


class CheckSymmetry(DeepmdDataSystem):
def __init__(
Expand Down
8 changes: 4 additions & 4 deletions source/tests/pt/test_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
import torch

tf.disable_eager_execution()
from pathlib import (
Path,
)

from deepmd.pt.loss import (
EnergyStdLoss,
)
Expand All @@ -20,10 +24,6 @@
from deepmd.tf.loss.ener import (
EnerStdLoss,
)
from pathlib import (
Path,
)


CUR_DIR = os.path.dirname(__file__)

Expand Down
10 changes: 5 additions & 5 deletions source/tests/pt/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

tf.disable_eager_execution()

from pathlib import (
Path,
)

from deepmd.pt.loss import (
EnergyStdLoss,
)
Expand All @@ -19,7 +23,7 @@
DpLoaderSet,
)
from deepmd.pt.utils.env import (
DEVICE
DEVICE,
)
from deepmd.pt.utils.learning_rate import LearningRateExp as MyLRExp
from deepmd.pt.utils.stat import (
Expand All @@ -46,10 +50,6 @@
LearningRateExp,
)

from pathlib import (
Path,
)

VariableState = collections.namedtuple("VariableState", ["value", "gradient"])


Expand Down
7 changes: 3 additions & 4 deletions source/tests/pt/test_rotation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
import json
import unittest
from pathlib import (
Path,
)
from typing import (
List,
Optional,
Expand Down Expand Up @@ -28,10 +31,6 @@
make_stat_input,
)

from pathlib import (
Path,
)


class CheckSymmetry(DeepmdDataSystem):
def __init__(
Expand Down
9 changes: 3 additions & 6 deletions source/tests/pt/test_sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
import json
import os
import unittest
from pathlib import (
Path,
)

import numpy as np
from torch.utils.data import (
DataLoader,
)

from deepmd.pt.utils import (
env,
)
from deepmd.pt.utils.dataloader import (
DpLoaderSet,
get_weighted_sampler,
Expand All @@ -22,9 +22,6 @@
from deepmd.tf.utils.data_system import (
DeepmdDataSystem,
)
from pathlib import (
Path,
)

CUR_DIR = os.path.dirname(__file__)

Expand Down
6 changes: 3 additions & 3 deletions source/tests/pt/test_saveload_se_e2_a.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
import json
import os
import unittest
from pathlib import (
Path,
)

import torch
from torch.utils.data import (
Expand Down Expand Up @@ -31,9 +34,6 @@
from deepmd.tf.common import (
expand_sys_str,
)
from pathlib import (
Path,
)


def get_dataset(config):
Expand Down
7 changes: 3 additions & 4 deletions source/tests/pt/test_stat.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
import json
import os
import unittest
from pathlib import (
Path,
)

import numpy as np
import torch
Expand Down Expand Up @@ -33,10 +36,6 @@
DeepmdDataSystem,
)

from pathlib import (
Path,
)

CUR_DIR = os.path.dirname(__file__)


Expand Down

0 comments on commit 1cfb432

Please sign in to comment.