From d9cc2204caa47d0dc828a9a15c4f4d87b5bd8437 Mon Sep 17 00:00:00 2001 From: Florian Maurer Date: Thu, 21 Nov 2024 12:38:25 +0100 Subject: [PATCH 1/2] fix missing database check when doing RL without a given database This fixes commands like: assume -s example_02a -c tiny --- assume/common/outputs.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/assume/common/outputs.py b/assume/common/outputs.py index b79abd54..ce8d8603 100644 --- a/assume/common/outputs.py +++ b/assume/common/outputs.py @@ -568,9 +568,9 @@ def get_sum_reward(self): query = text( f"select unit, SUM(reward) FROM rl_params where simulation='{self.simulation_id}' GROUP BY unit" ) - - with self.db.begin() as db: - rewards_by_unit = db.execute(query).fetchall() + if self.db is not None: + with self.db.begin() as db: + rewards_by_unit = db.execute(query).fetchall() # convert into a numpy array rewards_by_unit = [r[1] for r in rewards_by_unit] From fe85a55d5829e757f27fe09c74018ed7d9b8a3f2 Mon Sep 17 00:00:00 2001 From: Florian Maurer Date: Thu, 21 Nov 2024 12:55:58 +0100 Subject: [PATCH 2/2] add 3.13 to supported python version classifiers though this does not bring noticable performance boosts --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 4ea505c1..bb18c2aa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,6 +26,7 @@ classifiers=[ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", ] requires-python = ">=3.10" dependencies = [