From 3639cd6566718097c910a2cde60443e84a765b99 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Fri, 11 Mar 2022 18:07:33 -0500 Subject: [PATCH] breaking: adjust the default precision to float64 We've found float32 is not enough for some systems. This is a breaking change. One who wants to continue to use float32 must explicitly assign precision. --- dpdata/plugins/deepmd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dpdata/plugins/deepmd.py b/dpdata/plugins/deepmd.py index 6fd209a3f..b8a520686 100644 --- a/dpdata/plugins/deepmd.py +++ b/dpdata/plugins/deepmd.py @@ -29,7 +29,7 @@ class DeePMDCompFormat(Format): def from_system(self, file_name, type_map=None, **kwargs): return dpdata.deepmd.comp.to_system_data(file_name, type_map=type_map, labels=False) - def to_system(self, data, file_name, set_size=5000, prec=np.float32, **kwargs): + def to_system(self, data, file_name, set_size=5000, prec=np.float64, **kwargs): """ Dump the system in deepmd compressed format (numpy binary) to `folder`. @@ -83,7 +83,7 @@ def to_system(self, data : dict, file_name : str, set_size : int = 5000, - comp_prec : np.dtype = np.float32, + comp_prec : np.dtype = np.float64, **kwargs): s = file_name.split("#") name = s[1] if len(s) > 1 else ""