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] 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 = [