Skip to content

Commit

Permalink
Deepcopy dict to avoid reference issue
Browse files Browse the repository at this point in the history
  • Loading branch information
FNTwin committed Nov 29, 2023
1 parent f38bda1 commit 0197dd0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/openqdc/datasets/base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import pickle as pkl
from copy import deepcopy
from os.path import join as p_join
from typing import Dict, List, Optional, Union

Expand Down Expand Up @@ -560,7 +561,7 @@ def get_statistics(self, normalization: str = "formation", return_none: bool = T
Whether to return None if the statistics for the forces are not available, by default True
Otherwise, the statistics for the forces are set to 0.0
"""
stats = self._stats
stats = deepcopy(self._stats)
if len(stats) == 0:
raise StatisticsNotAvailableError(self.__name__)
if normalization not in POSSIBLE_NORMALIZATION:
Expand Down

0 comments on commit 0197dd0

Please sign in to comment.