From 6ea5cb6f886fab2ed80bc26422dd152282626160 Mon Sep 17 00:00:00 2001 From: Feng Tian <134106614+ftian9@users.noreply.github.com> Date: Wed, 24 Jun 2026 09:21:58 -0700 Subject: [PATCH 1/3] skip downloading the moments file if it already exists --- molskill/data/standardization.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/molskill/data/standardization.py b/molskill/data/standardization.py index 2f2ab19..2075425 100644 --- a/molskill/data/standardization.py +++ b/molskill/data/standardization.py @@ -29,7 +29,7 @@ def get_population_moments( Dict[str, np.ndarray]: population {mean: np.ndarray, std: np.ndarray} """ - if moment_csv is None: + if moment_csv is None and not os.path.exists(MOMENT_CSV): LOGGER.info("Standardization moments not found. Downloading from remote...") moment_csv = MOMENT_CSV os.makedirs(ASSET_PATH, exist_ok=True) From a53bb105b4ebfed2afaebe5067e1bd341e16cbc0 Mon Sep 17 00:00:00 2001 From: Feng Tian <134106614+ftian9@users.noreply.github.com> Date: Wed, 24 Jun 2026 09:32:08 -0700 Subject: [PATCH 2/3] check moments file size --- molskill/data/standardization.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/molskill/data/standardization.py b/molskill/data/standardization.py index 2075425..266e76e 100644 --- a/molskill/data/standardization.py +++ b/molskill/data/standardization.py @@ -29,7 +29,7 @@ def get_population_moments( Dict[str, np.ndarray]: population {mean: np.ndarray, std: np.ndarray} """ - if moment_csv is None and not os.path.exists(MOMENT_CSV): + if moment_csv is None and (not os.path.exists(MOMENT_CSV)) or (os.path.getsize(MOMENT_CSV) == 0): LOGGER.info("Standardization moments not found. Downloading from remote...") moment_csv = MOMENT_CSV os.makedirs(ASSET_PATH, exist_ok=True) From 9462620c944af9cf18484e4e37c14e7af8dc9242 Mon Sep 17 00:00:00 2001 From: Feng Tian <134106614+ftian9@users.noreply.github.com> Date: Wed, 24 Jun 2026 09:46:15 -0700 Subject: [PATCH 3/3] update variable moment_csv if it is None --- molskill/data/standardization.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/molskill/data/standardization.py b/molskill/data/standardization.py index 266e76e..fd85542 100644 --- a/molskill/data/standardization.py +++ b/molskill/data/standardization.py @@ -29,11 +29,12 @@ def get_population_moments( Dict[str, np.ndarray]: population {mean: np.ndarray, std: np.ndarray} """ - if moment_csv is None and (not os.path.exists(MOMENT_CSV)) or (os.path.getsize(MOMENT_CSV) == 0): - LOGGER.info("Standardization moments not found. Downloading from remote...") + if moment_csv is None: moment_csv = MOMENT_CSV - os.makedirs(ASSET_PATH, exist_ok=True) - download(DEFAULT_MOMENTS_REMOTE, moment_csv) + if (not os.path.exists(moment_csv)) or (os.path.getsize(moment_csv) == 0): + LOGGER.info("Standardization moments not found. Downloading from remote...") + os.makedirs(ASSET_PATH, exist_ok=True) + download(DEFAULT_MOMENTS_REMOTE, moment_csv) population_df = pd.read_csv(moment_csv, index_col="descriptor") assert set(population_df.keys()) == {