Skip to content

Commit

Permalink
Merge pull request #99 from diningphil/fix_filter_exp
Browse files Browse the repository at this point in the history
minor fix in filter_experiments
  • Loading branch information
diningphil authored Jul 25, 2024
2 parents 669c3ec + d79d7d7 commit 8084a8c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Changelog
## [1.5.8] Minor fix

## Fixed

- Minor fix in `filter_experiments`

## [1.5.7] Improving experiment retrieval routines

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ---------------------------------------------------
Expand Down
14 changes: 7 additions & 7 deletions pydgn/evaluation/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 8084a8c

Please sign in to comment.