From 8cdd5146278473157cb83170dc53c9aa0adb5b2c Mon Sep 17 00:00:00 2001 From: "weihong.xu" Date: Tue, 28 Nov 2023 10:55:07 +0800 Subject: [PATCH] fix: copy dataset list to avoid side-effect --- ai2_kit/domain/deepmd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ai2_kit/domain/deepmd.py b/ai2_kit/domain/deepmd.py index 76bbb1ca..1014308d 100644 --- a/ai2_kit/domain/deepmd.py +++ b/ai2_kit/domain/deepmd.py @@ -118,7 +118,7 @@ async def cll_deepmd(input: CllDeepmdInput, ctx: CllDeepmdContext): model_paths = executor.run_python_fn(expand_globs)(input.config.fixture_models) assert len(model_paths) > 0, f'No fixture models found: {input.config.fixture_models}' return GenericDeepmdOutput( - dataset=input.old_dataset, + dataset=input.old_dataset.copy(), models=[Artifact.of(url=url, format=DataFormat.DEEPMD_MODEL) for url in model_paths] ) @@ -131,7 +131,7 @@ async def cll_deepmd(input: CllDeepmdInput, ctx: CllDeepmdContext): init_dataset = ctx.resource_manager.resolve_artifacts(input.config.init_dataset) # input dataset contains data that generated by previous iteration # it should not contain the initial dataset - input_dataset: List[Artifact] = input.old_dataset + input_dataset: List[Artifact] = input.old_dataset.copy() # make new dataset from raw data new_dataset, outlier_dataset = executor.run_python_fn(make_deepmd_dataset)(