From f1e3ec82f03c622b812627c37d2eb746ff951f22 Mon Sep 17 00:00:00 2001 From: Leni Aniva Date: Wed, 11 Dec 2024 16:54:50 -0800 Subject: [PATCH] fix: Goal state pickling/unpickling --- pantograph/server.py | 13 +++++++++---- src | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/pantograph/server.py b/pantograph/server.py index 284694e..3e26edd 100644 --- a/pantograph/server.py +++ b/pantograph/server.py @@ -314,15 +314,20 @@ class Server: }) if "error" in result: raise ServerError(result["desc"]) - def goal_load(self, path: str) -> int: - # FIXME: Load the entire state + def goal_load(self, path: str) -> GoalState: result = self.run('goal.load', { "path": path, }) if "error" in result: raise ServerError(result["desc"]) state_id = result['id'] - return state_id + result = self.run('goal.print', { + 'stateId': state_id, + 'goals': True, + }) + if "error" in result: + raise ServerError(result["desc"]) + return GoalState.parse(result, self.to_remove_goal_states) def get_version(): @@ -336,7 +341,7 @@ def get_version(): class TestServer(unittest.TestCase): def test_version(self): - self.assertEqual(get_version(), "0.2.22") + self.assertEqual(get_version(), "0.2.23") def test_expr_type(self): server = Server() diff --git a/src b/src index 5d76626..3744cfa 160000 --- a/src +++ b/src @@ -1 +1 @@ -Subproject commit 5d76626912795579832f2bb43748e137bb6d0595 +Subproject commit 3744cfaa9608cd43e00078283339662b3720949b