From f9f1eb73e0d81ae5a892d9a071d7e11eee8b864b Mon Sep 17 00:00:00 2001 From: diphosphane Date: Wed, 2 Mar 2022 11:46:52 +0800 Subject: [PATCH] bug fix for "_bmark_cache.npz file stores at program path" --- sgdml/cli.py | 4 ++-- sgdml/predict.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sgdml/cli.py b/sgdml/cli.py index 08e5e81..f8c627c 100644 --- a/sgdml/cli.py +++ b/sgdml/cli.py @@ -1613,9 +1613,9 @@ def reset(command=None, **kwargs): if ui.yes_or_no('\nDo you really want to purge all caches and temporary files?'): - pkg_dir = os.path.dirname(os.path.abspath(__file__)) + curr_dir = os.getcwd() bmark_file = '_bmark_cache.npz' - bmark_path = os.path.join(pkg_dir, bmark_file) + bmark_path = os.path.join(curr_dir, bmark_file) if os.path.exists(bmark_path): try: diff --git a/sgdml/predict.py b/sgdml/predict.py index 40f39b7..f3c1202 100644 --- a/sgdml/predict.py +++ b/sgdml/predict.py @@ -890,9 +890,9 @@ def _dummy_predict(): def _save_cached_bmark_result(self, n_bulk, num_workers, chunk_size, bulk_mp, gps): - pkg_dir = os.path.dirname(os.path.abspath(__file__)) + curr_dir = os.getcwd() bmark_file = '_bmark_cache.npz' - bmark_path = os.path.join(pkg_dir, bmark_file) + bmark_path = os.path.join(curr_dir, bmark_file) bkey = '{}-{}-{}-{}'.format( self.n_atoms, self.n_train, n_bulk, self.max_processes @@ -922,9 +922,9 @@ def _save_cached_bmark_result(self, n_bulk, num_workers, chunk_size, bulk_mp, gp def _load_cached_bmark_result(self, n_bulk): - pkg_dir = os.path.dirname(os.path.abspath(__file__)) + curr_dir = os.getcwd() bmark_file = '_bmark_cache.npz' - bmark_path = os.path.join(pkg_dir, bmark_file) + bmark_path = os.path.join(curr_dir, bmark_file) bkey = '{}-{}-{}-{}'.format( self.n_atoms, self.n_train, n_bulk, self.max_processes