Skip to content

Commit

Permalink
Remove use_list condition
Browse files Browse the repository at this point in the history
  • Loading branch information
samwaseda committed Feb 9, 2025
1 parent eda9433 commit 915cd46
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions semantikon/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
_to_units_container,
_replace_units,
)
from ast import literal_eval
from typing import get_origin, get_args

__author__ = "Sam Waseda"
Expand Down Expand Up @@ -44,14 +43,8 @@ def parse_metadata(value):
dictionary of the metadata. Available keys are `units`, `label`,
`triples`, `uri` and `shape`. See `semantikon.typing.u` for more details.
"""
not_use_list = len(value.__metadata__) == 1 and isinstance(
value.__metadata__[0], str
)
if not_use_list:
return literal_eval(value.__metadata__[0])
else:
metadata = value.__metadata__[0]
return {k: v for k, v in zip(metadata[::2], metadata[1::2])}
metadata = value.__metadata__[0]
return {k: v for k, v in zip(metadata[::2], metadata[1::2])}


def meta_to_dict(value):
Expand Down

0 comments on commit 915cd46

Please sign in to comment.