From e23b9f81814014d2591b80c65e13908b8d86b207 Mon Sep 17 00:00:00 2001 From: "k.schulze" Date: Thu, 27 Jun 2024 11:02:10 +0200 Subject: [PATCH 1/2] fixed bug within options.py that removed all passed solver_opts due to a missing negation operator --- pyaugmecon/options.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyaugmecon/options.py b/pyaugmecon/options.py index 0c29a41..a3085a0 100644 --- a/pyaugmecon/options.py +++ b/pyaugmecon/options.py @@ -44,7 +44,7 @@ def __init__(self, opts: dict, solver_opts: dict): # Remove None values from dict when user has overriden them for key, value in dict(self.solver_opts).items(): - if value is None or value: + if value is None or not value: del self.solver_opts[key] self.time_created = time.strftime("%Y%m%d-%H%M%S") # Time the options object was created From e640d78dfecb5f28ed3f1283c7dbb4051cd4a765 Mon Sep 17 00:00:00 2001 From: "k.schulze" Date: Mon, 1 Jul 2024 10:19:42 +0200 Subject: [PATCH 2/2] minor adjustment to allow 0 as a viable input --- pyaugmecon/options.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyaugmecon/options.py b/pyaugmecon/options.py index a3085a0..25c3f24 100644 --- a/pyaugmecon/options.py +++ b/pyaugmecon/options.py @@ -44,7 +44,7 @@ def __init__(self, opts: dict, solver_opts: dict): # Remove None values from dict when user has overriden them for key, value in dict(self.solver_opts).items(): - if value is None or not value: + if value is None or (not value and value != 0): del self.solver_opts[key] self.time_created = time.strftime("%Y%m%d-%H%M%S") # Time the options object was created