From 711f4a03de4f7c172b63e5120376aec32dbda77e Mon Sep 17 00:00:00 2001 From: Chun Cai Date: Fri, 1 Aug 2025 15:53:03 +0800 Subject: [PATCH 1/8] feat: support rglob patterns for dp test --- deepmd/entrypoints/test.py | 22 +++++++++- deepmd/main.py | 7 ++++ source/tests/pt/test_dp_test.py | 71 +++++++++++++++++++++++++++++++-- 3 files changed, 96 insertions(+), 4 deletions(-) diff --git a/deepmd/entrypoints/test.py b/deepmd/entrypoints/test.py index db605b0de1..51597b4531 100644 --- a/deepmd/entrypoints/test.py +++ b/deepmd/entrypoints/test.py @@ -14,6 +14,7 @@ from deepmd.common import ( expand_sys_str, + j_loader, ) from deepmd.infer.deep_dipole import ( DeepDipole, @@ -41,6 +42,9 @@ from deepmd.utils.data import ( DeepmdData, ) +from deepmd.utils.data_system import ( + process_systems, +) from deepmd.utils.weight_avg import ( weighted_average, ) @@ -60,6 +64,7 @@ def test( model: str, system: str, datafile: str, + input_json: Optional[str] = None, numb_test: int, rand_seed: Optional[int], shuffle_test: bool, @@ -78,6 +83,8 @@ def test( system directory datafile : str the path to the list of systems to test + input_json : Optional[str] + the training input json file. Validation systems in this file will be used. numb_test : int munber of tests to do. 0 means all data. rand_seed : Optional[int] @@ -101,7 +108,20 @@ def test( if numb_test == 0: # only float has inf, but should work for min numb_test = float("inf") - if datafile is not None: + if input_json is not None: + jdata = j_loader(input_json) + val_params = jdata.get("training", {}).get("validation_data", {}) + validation = val_params.get("systems") + if not validation: + raise RuntimeError("No validation data found in input json") + root = Path(input_json).parent + if isinstance(validation, str): + validation = str((root / Path(validation)).resolve()) + else: + validation = [str((root / Path(ss)).resolve()) for ss in validation] + patterns = val_params.get("rglob_patterns", None) + all_sys = process_systems(validation, patterns=patterns) + elif datafile is not None: with open(datafile) as datalist: all_sys = datalist.read().splitlines() else: diff --git a/deepmd/main.py b/deepmd/main.py index 2db781b201..0e52caba92 100644 --- a/deepmd/main.py +++ b/deepmd/main.py @@ -371,6 +371,13 @@ def main_parser() -> argparse.ArgumentParser: type=str, help="The path to the datafile, each line of which is a path to one data system.", ) + parser_tst_subgroup.add_argument( + "-i", + "--input-json", + default=None, + type=str, + help="The training input json file. Validation data in the training script will be used for testing.", + ) parser_tst.add_argument( "-S", "--set-prefix", diff --git a/source/tests/pt/test_dp_test.py b/source/tests/pt/test_dp_test.py index c2915c7ee7..4ab05c4164 100644 --- a/source/tests/pt/test_dp_test.py +++ b/source/tests/pt/test_dp_test.py @@ -30,7 +30,7 @@ class DPTest: - def test_dp_test_1_frame(self) -> None: + def _run_dp_test(self, use_input_json: bool, numb_test: int = 0) -> None: trainer = get_trainer(deepcopy(self.config)) with torch.device("cpu"): input_dict, label_dict, _ = trainer.get_data(is_train=False) @@ -44,12 +44,16 @@ def test_dp_test_1_frame(self) -> None: model = torch.jit.script(trainer.model) tmp_model = tempfile.NamedTemporaryFile(delete=False, suffix=".pth") torch.jit.save(model, tmp_model.name) + val_sys = self.config["training"]["validation_data"]["systems"] + if isinstance(val_sys, list): + val_sys = val_sys[0] dp_test( model=tmp_model.name, - system=self.config["training"]["validation_data"]["systems"][0], + system=val_sys, datafile=None, + input_json=self.input_json if use_input_json else None, set_prefix="set", - numb_test=0, + numb_test=numb_test, rand_seed=None, shuffle_test=False, detail_file=self.detail_file, @@ -93,6 +97,12 @@ def test_dp_test_1_frame(self) -> None: ).reshape(-1, 3), ) + def test_dp_test_1_frame(self) -> None: + self._run_dp_test(False) + + def test_dp_test_input_json(self) -> None: + self._run_dp_test(True) + def tearDown(self) -> None: for f in os.listdir("."): if f.startswith("model") and f.endswith(".pt"): @@ -140,6 +150,61 @@ def setUp(self) -> None: json.dump(self.config, fp, indent=4) +class TestDPTestSeARglob(unittest.TestCase): + def setUp(self) -> None: + self.detail_file = "test_dp_test_ener_rglob_detail" + input_json = str(Path(__file__).parent / "water/se_atten.json") + with open(input_json) as f: + self.config = json.load(f) + self.config["training"]["numb_steps"] = 1 + self.config["training"]["save_freq"] = 1 + data_file = [str(Path(__file__).parent / "water/data/single")] + self.config["training"]["training_data"]["systems"] = data_file + root_dir = str(Path(__file__).parent) + self.config["training"]["validation_data"]["systems"] = root_dir + self.config["training"]["validation_data"]["rglob_patterns"] = [ + "water/data/single" + ] + self.config["model"] = deepcopy(model_se_e2_a) + self.input_json = "test_dp_test_rglob.json" + with open(self.input_json, "w") as fp: + json.dump(self.config, fp, indent=4) + + def test_dp_test_input_json_rglob(self) -> None: + trainer = get_trainer(deepcopy(self.config)) + with torch.device("cpu"): + input_dict, _, _ = trainer.get_data(is_train=False) + input_dict.pop("spin", None) + model = torch.jit.script(trainer.model) + tmp_model = tempfile.NamedTemporaryFile(delete=False, suffix=".pth") + torch.jit.save(model, tmp_model.name) + dp_test( + model=tmp_model.name, + system=self.config["training"]["validation_data"]["systems"], + datafile=None, + input_json=self.input_json, + set_prefix="set", + numb_test=1, + rand_seed=None, + shuffle_test=False, + detail_file=self.detail_file, + atomic=False, + ) + os.unlink(tmp_model.name) + self.assertTrue(os.path.exists(self.detail_file + ".e.out")) + + def tearDown(self) -> None: + for f in os.listdir("."): + if f.startswith("model") and f.endswith(".pt"): + os.remove(f) + if f.startswith(self.detail_file): + os.remove(f) + if f in ["lcurve.out", self.input_json]: + os.remove(f) + if f in ["stat_files"]: + shutil.rmtree(f) + + class TestDPTestPropertySeA(unittest.TestCase): def setUp(self) -> None: self.detail_file = "test_dp_test_property_detail" From 66d7e36d1b826d40283ac43cbd3a7978adeb1dbf Mon Sep 17 00:00:00 2001 From: Chun Cai Date: Fri, 1 Aug 2025 17:26:21 +0800 Subject: [PATCH 2/8] refactor: enforce exclusive test data sources --- deepmd/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deepmd/main.py b/deepmd/main.py index 0e52caba92..097b9125ff 100644 --- a/deepmd/main.py +++ b/deepmd/main.py @@ -356,7 +356,7 @@ def main_parser() -> argparse.ArgumentParser: type=str, help="Frozen model file (prefix) to import. TensorFlow backend: suffix is .pb; PyTorch backend: suffix is .pth.", ) - parser_tst_subgroup = parser_tst.add_mutually_exclusive_group() + parser_tst_subgroup = parser_tst.add_mutually_exclusive_group(required=True) parser_tst_subgroup.add_argument( "-s", "--system", From 72c57c7be4fd080ace71fc51236dc2f937f7a8c2 Mon Sep 17 00:00:00 2001 From: Chun Cai Date: Fri, 1 Aug 2025 17:30:09 +0800 Subject: [PATCH 3/8] Update deepmd/entrypoints/test.py Signed-off-by: Chun Cai --- deepmd/entrypoints/test.py | 1 + 1 file changed, 1 insertion(+) diff --git a/deepmd/entrypoints/test.py b/deepmd/entrypoints/test.py index 51597b4531..253daf06b0 100644 --- a/deepmd/entrypoints/test.py +++ b/deepmd/entrypoints/test.py @@ -110,6 +110,7 @@ def test( numb_test = float("inf") if input_json is not None: jdata = j_loader(input_json) + jdata = update_deepmd_input(jdata) val_params = jdata.get("training", {}).get("validation_data", {}) validation = val_params.get("systems") if not validation: From a00133bcd8c8fb66762992a3f1b90ff4c26deac0 Mon Sep 17 00:00:00 2001 From: Chun Cai Date: Mon, 4 Aug 2025 16:05:42 +0800 Subject: [PATCH 4/8] add training data option --- deepmd/entrypoints/test.py | 29 +++++++++----- deepmd/main.py | 6 +++ source/tests/pt/test_dp_test.py | 69 ++++++++++++++++++++++++++++++++- 3 files changed, 93 insertions(+), 11 deletions(-) diff --git a/deepmd/entrypoints/test.py b/deepmd/entrypoints/test.py index 253daf06b0..5043d98a68 100644 --- a/deepmd/entrypoints/test.py +++ b/deepmd/entrypoints/test.py @@ -39,6 +39,7 @@ DeepWFC, ) from deepmd.utils import random as dp_random +from deepmd.utils.compat import update_deepmd_input from deepmd.utils.data import ( DeepmdData, ) @@ -65,6 +66,7 @@ def test( system: str, datafile: str, input_json: Optional[str] = None, + use_train: bool = False, numb_test: int, rand_seed: Optional[int], shuffle_test: bool, @@ -84,7 +86,9 @@ def test( datafile : str the path to the list of systems to test input_json : Optional[str] - the training input json file. Validation systems in this file will be used. + the training input.json file. Validation systems will be used if use_train is False. + use_train : bool + use training systems in the input.json file instead of validation systems numb_test : int munber of tests to do. 0 means all data. rand_seed : Optional[int] @@ -111,17 +115,22 @@ def test( if input_json is not None: jdata = j_loader(input_json) jdata = update_deepmd_input(jdata) - val_params = jdata.get("training", {}).get("validation_data", {}) - validation = val_params.get("systems") - if not validation: - raise RuntimeError("No validation data found in input json") + data_key = "training_data" if use_train else "validation_data" + data_params = jdata.get("training", {}).get(data_key, {}) + systems = data_params.get("systems") + if not systems: + raise RuntimeError( + f"No {'training' if use_train else 'validation'} data found in input json" + ) root = Path(input_json).parent - if isinstance(validation, str): - validation = str((root / Path(validation)).resolve()) + if isinstance(systems, str): + systems = str((root / Path(systems)).resolve()) else: - validation = [str((root / Path(ss)).resolve()) for ss in validation] - patterns = val_params.get("rglob_patterns", None) - all_sys = process_systems(validation, patterns=patterns) + systems = [str((root / Path(ss)).resolve()) for ss in systems] + patterns = data_params.get("rglob_patterns", None) + all_sys = process_systems(systems, patterns=patterns) + elif use_train: + raise RuntimeError("--train-data requires --input-json") elif datafile is not None: with open(datafile) as datalist: all_sys = datalist.read().splitlines() diff --git a/deepmd/main.py b/deepmd/main.py index 097b9125ff..ee953cc3d4 100644 --- a/deepmd/main.py +++ b/deepmd/main.py @@ -378,6 +378,12 @@ def main_parser() -> argparse.ArgumentParser: type=str, help="The training input json file. Validation data in the training script will be used for testing.", ) + parser_tst.add_argument( + "--train-data", + action="store_true", + dest="use_train", + help="Use training data in the input json file instead of validation data.", + ) parser_tst.add_argument( "-S", "--set-prefix", diff --git a/source/tests/pt/test_dp_test.py b/source/tests/pt/test_dp_test.py index 4ab05c4164..ca042fc5a3 100644 --- a/source/tests/pt/test_dp_test.py +++ b/source/tests/pt/test_dp_test.py @@ -30,7 +30,9 @@ class DPTest: - def _run_dp_test(self, use_input_json: bool, numb_test: int = 0) -> None: + def _run_dp_test( + self, use_input_json: bool, numb_test: int = 0, use_train: bool = False + ) -> None: trainer = get_trainer(deepcopy(self.config)) with torch.device("cpu"): input_dict, label_dict, _ = trainer.get_data(is_train=False) @@ -52,6 +54,7 @@ def _run_dp_test(self, use_input_json: bool, numb_test: int = 0) -> None: system=val_sys, datafile=None, input_json=self.input_json if use_input_json else None, + use_train=use_train, set_prefix="set", numb_test=numb_test, rand_seed=None, @@ -103,6 +106,14 @@ def test_dp_test_1_frame(self) -> None: def test_dp_test_input_json(self) -> None: self._run_dp_test(True) + def test_dp_test_input_json_train(self) -> None: + with open(self.input_json) as f: + cfg = json.load(f) + cfg["training"]["validation_data"]["systems"] = ["non-existent"] + with open(self.input_json, "w") as f: + json.dump(cfg, f, indent=4) + self._run_dp_test(True, use_train=True) + def tearDown(self) -> None: for f in os.listdir("."): if f.startswith("model") and f.endswith(".pt"): @@ -205,6 +216,62 @@ def tearDown(self) -> None: shutil.rmtree(f) +class TestDPTestSeARglobTrain(unittest.TestCase): + def setUp(self) -> None: + self.detail_file = "test_dp_test_ener_rglob_train_detail" + input_json = str(Path(__file__).parent / "water/se_atten.json") + with open(input_json) as f: + self.config = json.load(f) + self.config["training"]["numb_steps"] = 1 + self.config["training"]["save_freq"] = 1 + root_dir = str(Path(__file__).parent) + self.config["training"]["training_data"]["systems"] = root_dir + self.config["training"]["training_data"]["rglob_patterns"] = [ + "water/data/single" + ] + data_file = [str(Path(__file__).parent / "water/data/single")] + self.config["training"]["validation_data"]["systems"] = data_file + self.config["model"] = deepcopy(model_se_e2_a) + self.input_json = "test_dp_test_rglob_train.json" + with open(self.input_json, "w") as fp: + json.dump(self.config, fp, indent=4) + + def test_dp_test_input_json_rglob_train(self) -> None: + trainer = get_trainer(deepcopy(self.config)) + with torch.device("cpu"): + input_dict, _, _ = trainer.get_data(is_train=False) + input_dict.pop("spin", None) + model = torch.jit.script(trainer.model) + tmp_model = tempfile.NamedTemporaryFile(delete=False, suffix=".pth") + torch.jit.save(model, tmp_model.name) + dp_test( + model=tmp_model.name, + system=self.config["training"]["validation_data"]["systems"], + datafile=None, + input_json=self.input_json, + use_train=True, + set_prefix="set", + numb_test=1, + rand_seed=None, + shuffle_test=False, + detail_file=self.detail_file, + atomic=False, + ) + os.unlink(tmp_model.name) + self.assertTrue(os.path.exists(self.detail_file + ".e.out")) + + def tearDown(self) -> None: + for f in os.listdir("."): + if f.startswith("model") and f.endswith(".pt"): + os.remove(f) + if f.startswith(self.detail_file): + os.remove(f) + if f in ["lcurve.out", self.input_json]: + os.remove(f) + if f in ["stat_files"]: + shutil.rmtree(f) + + class TestDPTestPropertySeA(unittest.TestCase): def setUp(self) -> None: self.detail_file = "test_dp_test_property_detail" From 6bbb957192847da718ad2324a321919f0511a9e7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 4 Aug 2025 08:07:24 +0000 Subject: [PATCH 5/8] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- deepmd/entrypoints/test.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/deepmd/entrypoints/test.py b/deepmd/entrypoints/test.py index 5043d98a68..b4c88c5715 100644 --- a/deepmd/entrypoints/test.py +++ b/deepmd/entrypoints/test.py @@ -39,7 +39,9 @@ DeepWFC, ) from deepmd.utils import random as dp_random -from deepmd.utils.compat import update_deepmd_input +from deepmd.utils.compat import ( + update_deepmd_input, +) from deepmd.utils.data import ( DeepmdData, ) From a256786dde715bb389a3e03c296a7a9d5318955f Mon Sep 17 00:00:00 2001 From: caic99 Date: Tue, 5 Aug 2025 06:56:59 +0000 Subject: [PATCH 6/8] fix ut --- deepmd/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deepmd/main.py b/deepmd/main.py index ee953cc3d4..bb7c27a0a5 100644 --- a/deepmd/main.py +++ b/deepmd/main.py @@ -356,7 +356,7 @@ def main_parser() -> argparse.ArgumentParser: type=str, help="Frozen model file (prefix) to import. TensorFlow backend: suffix is .pb; PyTorch backend: suffix is .pth.", ) - parser_tst_subgroup = parser_tst.add_mutually_exclusive_group(required=True) + parser_tst_subgroup = parser_tst.add_mutually_exclusive_group() parser_tst_subgroup.add_argument( "-s", "--system", From 7ae13fc8aa1827a06d3dc33d71e79428c0936c51 Mon Sep 17 00:00:00 2001 From: Chun Cai Date: Tue, 5 Aug 2025 15:10:25 +0800 Subject: [PATCH 7/8] Apply suggestion from @caic99 Signed-off-by: Chun Cai --- deepmd/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/deepmd/main.py b/deepmd/main.py index bb7c27a0a5..75baa1c367 100644 --- a/deepmd/main.py +++ b/deepmd/main.py @@ -380,6 +380,7 @@ def main_parser() -> argparse.ArgumentParser: ) parser_tst.add_argument( "--train-data", + "--train", action="store_true", dest="use_train", help="Use training data in the input json file instead of validation data.", From 0c0ca7ed5c9548f084438a3a598fee67b416cce3 Mon Sep 17 00:00:00 2001 From: Chun Cai Date: Fri, 29 Aug 2025 14:44:41 +0800 Subject: [PATCH 8/8] test: cover new data flags --- deepmd/entrypoints/test.py | 55 ++++++++++++--------- deepmd/main.py | 22 +++++---- source/tests/common/test_argument_parser.py | 26 ++++++++++ source/tests/pt/test_dp_test.py | 15 +++--- 4 files changed, 79 insertions(+), 39 deletions(-) diff --git a/deepmd/entrypoints/test.py b/deepmd/entrypoints/test.py index b4c88c5715..ee975e26c3 100644 --- a/deepmd/entrypoints/test.py +++ b/deepmd/entrypoints/test.py @@ -65,10 +65,10 @@ def test( *, model: str, - system: str, - datafile: str, - input_json: Optional[str] = None, - use_train: bool = False, + system: Optional[str], + datafile: Optional[str], + train_json: Optional[str] = None, + valid_json: Optional[str] = None, numb_test: int, rand_seed: Optional[int], shuffle_test: bool, @@ -83,16 +83,16 @@ def test( ---------- model : str path where model is stored - system : str + system : str, optional system directory - datafile : str + datafile : str, optional the path to the list of systems to test - input_json : Optional[str] - the training input.json file. Validation systems will be used if use_train is False. - use_train : bool - use training systems in the input.json file instead of validation systems + train_json : Optional[str] + Path to the input.json file provided via ``--train-data``. Training systems will be used for testing. + valid_json : Optional[str] + Path to the input.json file provided via ``--valid-data``. Validation systems will be used for testing. numb_test : int - munber of tests to do. 0 means all data. + number of tests to do. 0 means all data. rand_seed : Optional[int] seed for random generator shuffle_test : bool @@ -114,30 +114,41 @@ def test( if numb_test == 0: # only float has inf, but should work for min numb_test = float("inf") - if input_json is not None: - jdata = j_loader(input_json) + if train_json is not None: + jdata = j_loader(train_json) jdata = update_deepmd_input(jdata) - data_key = "training_data" if use_train else "validation_data" - data_params = jdata.get("training", {}).get(data_key, {}) + data_params = jdata.get("training", {}).get("training_data", {}) systems = data_params.get("systems") if not systems: - raise RuntimeError( - f"No {'training' if use_train else 'validation'} data found in input json" - ) - root = Path(input_json).parent + raise RuntimeError("No training data found in input json") + root = Path(train_json).parent + if isinstance(systems, str): + systems = str((root / Path(systems)).resolve()) + else: + systems = [str((root / Path(ss)).resolve()) for ss in systems] + patterns = data_params.get("rglob_patterns", None) + all_sys = process_systems(systems, patterns=patterns) + elif valid_json is not None: + jdata = j_loader(valid_json) + jdata = update_deepmd_input(jdata) + data_params = jdata.get("training", {}).get("validation_data", {}) + systems = data_params.get("systems") + if not systems: + raise RuntimeError("No validation data found in input json") + root = Path(valid_json).parent if isinstance(systems, str): systems = str((root / Path(systems)).resolve()) else: systems = [str((root / Path(ss)).resolve()) for ss in systems] patterns = data_params.get("rglob_patterns", None) all_sys = process_systems(systems, patterns=patterns) - elif use_train: - raise RuntimeError("--train-data requires --input-json") elif datafile is not None: with open(datafile) as datalist: all_sys = datalist.read().splitlines() - else: + elif system is not None: all_sys = expand_sys_str(system) + else: + raise RuntimeError("No data source specified for testing") if len(all_sys) == 0: raise RuntimeError("Did not find valid system") diff --git a/deepmd/main.py b/deepmd/main.py index 4a748a0f35..389ee10dfc 100644 --- a/deepmd/main.py +++ b/deepmd/main.py @@ -372,18 +372,22 @@ def main_parser() -> argparse.ArgumentParser: help="The path to the datafile, each line of which is a path to one data system.", ) parser_tst_subgroup.add_argument( - "-i", - "--input-json", + "--train-data", + dest="train_json", default=None, type=str, - help="The training input json file. Validation data in the training script will be used for testing.", + help=( + "The input json file. Training data in the file will be used for testing." + ), ) - parser_tst.add_argument( - "--train-data", - "--train", - action="store_true", - dest="use_train", - help="Use training data in the input json file instead of validation data.", + parser_tst_subgroup.add_argument( + "--valid-data", + dest="valid_json", + default=None, + type=str, + help=( + "The input json file. Validation data in the file will be used for testing." + ), ) parser_tst.add_argument( "-S", diff --git a/source/tests/common/test_argument_parser.py b/source/tests/common/test_argument_parser.py index 4e39df8659..4aebb7dafc 100644 --- a/source/tests/common/test_argument_parser.py +++ b/source/tests/common/test_argument_parser.py @@ -322,6 +322,32 @@ def test_parser_test(self) -> None: self.run_test(command="test", mapping=ARGS) + def test_parser_test_train_data(self) -> None: + """Test test subparser with train-data.""" + ARGS = { + "--model": {"type": str, "value": "MODEL.PB"}, + "--train-data": { + "type": (str, type(None)), + "value": "INPUT.JSON", + "dest": "train_json", + }, + } + + self.run_test(command="test", mapping=ARGS) + + def test_parser_test_valid_data(self) -> None: + """Test test subparser with valid-data.""" + ARGS = { + "--model": {"type": str, "value": "MODEL.PB"}, + "--valid-data": { + "type": (str, type(None)), + "value": "INPUT.JSON", + "dest": "valid_json", + }, + } + + self.run_test(command="test", mapping=ARGS) + def test_parser_compress(self) -> None: """Test compress subparser.""" ARGS = { diff --git a/source/tests/pt/test_dp_test.py b/source/tests/pt/test_dp_test.py index ca042fc5a3..5a8674e276 100644 --- a/source/tests/pt/test_dp_test.py +++ b/source/tests/pt/test_dp_test.py @@ -51,10 +51,10 @@ def _run_dp_test( val_sys = val_sys[0] dp_test( model=tmp_model.name, - system=val_sys, + system=None if use_input_json else val_sys, datafile=None, - input_json=self.input_json if use_input_json else None, - use_train=use_train, + train_json=self.input_json if use_input_json and use_train else None, + valid_json=self.input_json if use_input_json and not use_train else None, set_prefix="set", numb_test=numb_test, rand_seed=None, @@ -191,9 +191,9 @@ def test_dp_test_input_json_rglob(self) -> None: torch.jit.save(model, tmp_model.name) dp_test( model=tmp_model.name, - system=self.config["training"]["validation_data"]["systems"], + system=None, datafile=None, - input_json=self.input_json, + valid_json=self.input_json, set_prefix="set", numb_test=1, rand_seed=None, @@ -246,10 +246,9 @@ def test_dp_test_input_json_rglob_train(self) -> None: torch.jit.save(model, tmp_model.name) dp_test( model=tmp_model.name, - system=self.config["training"]["validation_data"]["systems"], + system=None, datafile=None, - input_json=self.input_json, - use_train=True, + train_json=self.input_json, set_prefix="set", numb_test=1, rand_seed=None,