Skip to content

Commit

Permalink
Remove useless function
Browse files Browse the repository at this point in the history
  • Loading branch information
tdayris committed Apr 2, 2024
1 parent b01f191 commit dfa0553
Showing 1 changed file with 0 additions and 41 deletions.
41 changes: 0 additions & 41 deletions workflow/rules/common.smk
Original file line number Diff line number Diff line change
Expand Up @@ -70,47 +70,6 @@ def is_variation_available(genome_property: str) -> bool:
return availability


def dlookup(
dpath: str | None = None,
query: str | None = None,
cols: list[str] | None = None,
within=None,
key: str | None = None,
default: str | dict[str, Any] | None = None,
) -> str:
"""
Allow default values and attribute getter in lookup function
Parameters:
dpath str | None : Passed to lookup function
query str | None : Passed to lookup function
cols str | None : Passed to lookup function
within object : Passed to lookup function
key str : Attribute name
default str | dict[str, Any] | None : Default value to return
"""
value = None
try:
value = lookup(dpath=dpath, query=query, cols=cols, within=within)
except LookupError:
value = default
except WorkflowError:
value = default
except KeyError:
value = default
except AttributeError:
value = default

if key is not None:
return getattr(
value,
key,
default,
)

return value


def lookup_config(
dpath: str, default: str | None = None, config: dict[str, Any] = config
) -> str:
Expand Down

0 comments on commit dfa0553

Please sign in to comment.