From 468a7721c87f98fd670e6d349b1cd95254544143 Mon Sep 17 00:00:00 2001 From: Marcel Date: Wed, 20 Nov 2024 17:01:09 +0100 Subject: [PATCH] [bugfix] changed default behavior of PylotParameter class to use default Parameter if called without input parameters. Related to #40 --- pylot/core/io/inputs.py | 6 ++++++ pylot/core/util/utils.py | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pylot/core/io/inputs.py b/pylot/core/io/inputs.py index 71888642..be899e30 100644 --- a/pylot/core/io/inputs.py +++ b/pylot/core/io/inputs.py @@ -53,10 +53,16 @@ class PylotParameter(object): self.__parameter = {} self._verbosity = verbosity self._parFileCont = {} + # io from parsed arguments alternatively for key, val in kwargs.items(): self._parFileCont[key] = val self.from_file() + + # if no filename or kwargs given, use default values + if not fnin and not kwargs: + self.reset_defaults() + if fnout: self.export2File(fnout) diff --git a/pylot/core/util/utils.py b/pylot/core/util/utils.py index ca0d86fc..c0e20171 100644 --- a/pylot/core/util/utils.py +++ b/pylot/core/util/utils.py @@ -51,7 +51,6 @@ def readDefaultFilterInformation(): :rtype: dict """ pparam = PylotParameter() - pparam.reset_defaults() return readFilterInformation(pparam)