From d79d7d730526f2fb8f235b14fffde4b84b90069f Mon Sep 17 00:00:00 2001 From: federico errica Date: Thu, 25 Jul 2024 08:51:17 +0000 Subject: [PATCH] minor fix in filter_experiments --- CHANGELOG.md | 5 +++++ docs/conf.py | 2 +- pydgn/evaluation/util.py | 14 +++++++------- pyproject.toml | 2 +- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 59fd5f8..74debd3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ # Changelog +## [1.5.8] Minor fix + +## Fixed + +- Minor fix in `filter_experiments` ## [1.5.7] Improving experiment retrieval routines diff --git a/docs/conf.py b/docs/conf.py index e5d1843..ee6eebc 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -24,7 +24,7 @@ author = "Federico Errica" # The full version, including alpha/beta/rc tags -release = "1.5.7" +release = "1.5.8" # -- General configuration --------------------------------------------------- diff --git a/pydgn/evaluation/util.py b/pydgn/evaluation/util.py index 4089d07..284101f 100644 --- a/pydgn/evaluation/util.py +++ b/pydgn/evaluation/util.py @@ -401,15 +401,15 @@ def filter_experiments( def _finditem(obj, key): if key in obj: - return obj[key] + return obj[key], True for k, v in obj.items(): if isinstance(v, dict): - item = _finditem(v, key) - if item is not None: - return item + item, found = _finditem(v, key) + if found: + return item, True - return None + return None, False assert logic in ["AND", "OR"], "logic can only be AND/OR case sensitive" @@ -420,8 +420,8 @@ def _finditem(obj, key): for k, v in parameters.items(): - cf_v = _finditem(config, k) - assert cf_v is not None, ( + cf_v, found = _finditem(config, k) + assert found, ( f"Key {k} not found in the " f"configuration, check your input" ) diff --git a/pyproject.toml b/pyproject.toml index a6ca502..526f199 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "pydgn" -version = "1.5.7" +version = "1.5.8" description = "A Python Package for Deep Graph Networks" authors = [ { name="Federico Errica", email="f.errica@protonmail.com" } ] readme = "README.md"