From 966748562ef94aac96dd4012dce078f6c7ba7d6e Mon Sep 17 00:00:00 2001 From: Saurabh Mogre Date: Wed, 18 Oct 2023 10:25:13 -0700 Subject: [PATCH 1/2] read grid file path from recipe if provided --- cellpack/autopack/Environment.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cellpack/autopack/Environment.py b/cellpack/autopack/Environment.py index 9545e614..e50b18b0 100644 --- a/cellpack/autopack/Environment.py +++ b/cellpack/autopack/Environment.py @@ -156,6 +156,8 @@ def __init__(self, config=None, recipe=None): self.grid_file_out = ( f"{self.out_folder}/{self.name}_{config['name']}_{self.version}_grid.dat" ) + if recipe.get("grid_file_path") is not None: + self.grid_file_out = recipe["grid_file_path"] should_load_grid_file = ( os.path.isfile(self.grid_file_out) and self.load_from_grid_file From 2d00f18f543e40532db7f82c18296456dee793e8 Mon Sep 17 00:00:00 2001 From: Saurabh Mogre Date: Wed, 18 Oct 2023 10:46:47 -0700 Subject: [PATCH 2/2] check if specified grid file exists, fall back to default if not --- cellpack/autopack/Environment.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cellpack/autopack/Environment.py b/cellpack/autopack/Environment.py index e50b18b0..023d4dcb 100644 --- a/cellpack/autopack/Environment.py +++ b/cellpack/autopack/Environment.py @@ -157,7 +157,8 @@ def __init__(self, config=None, recipe=None): f"{self.out_folder}/{self.name}_{config['name']}_{self.version}_grid.dat" ) if recipe.get("grid_file_path") is not None: - self.grid_file_out = recipe["grid_file_path"] + if os.path.isfile(recipe["grid_file_path"]): + self.grid_file_out = recipe["grid_file_path"] should_load_grid_file = ( os.path.isfile(self.grid_file_out) and self.load_from_grid_file