Skip to content

Commit 0da4265

Browse files
authored
Merge pull request #154 from mila-iqia/edit_hot_fix
Fix copy thingy.
2 parents 4606183 + 869221a commit 0da4265

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/diffusion_for_multi_scale_molecular_dynamics/active_learning_loop/configuration_parsing.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from copy import deepcopy
12
from typing import Any, AnyStr, Dict, List, Optional, Tuple, Union
23

34
import torch
@@ -152,8 +153,9 @@ def get_sample_maker_from_configuration(
152153
Returns:
153154
sample_maker: A configured Sample Maker instance.
154155
"""
155-
# Let's make sure we don't modify the input, which would lead to undesirable side effects!
156-
sampling_dict = sampling_dictionary.copy()
156+
# We use deepcopy to make sure we don't modify anything (including mutable internal dictionaries!)
157+
# in the input configuration.
158+
sampling_dict = deepcopy(sampling_dictionary)
157159

158160
noise_parameters, sampling_parameters, axl_network, device = get_repaint_parameters(
159161
sampling_dictionary=sampling_dict,

0 commit comments

Comments
 (0)