From 08a2b3baa4e364e67cef9d573c4cb56f87f188aa Mon Sep 17 00:00:00 2001 From: Ben Chen <6263622+ben-c-2013@users.noreply.github.com> Date: Thu, 26 Mar 2026 16:06:10 +0100 Subject: [PATCH] Edited Runnable.load() and added an option to load a .obj using a specified path. --- src/abel/classes/runnable.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/abel/classes/runnable.py b/src/abel/classes/runnable.py index c82497e4..fa0e554b 100644 --- a/src/abel/classes/runnable.py +++ b/src/abel/classes/runnable.py @@ -154,9 +154,11 @@ def save(self): pickle.dump(self, savefile) # load object from file - def load(self, shot=None): + def load(self, shot=None, obj_path=None): import dill as pickle - with open(self.object_path(shot), 'rb') as loadfile: + if obj_path is None: + obj_path = self.object_path(shot) + with open(obj_path, 'rb') as loadfile: try: obj = pickle.load(loadfile) return obj