Skip to content

Commit

Permalink
Remove unecessary checks for ! notation
Browse files Browse the repository at this point in the history
  • Loading branch information
domna committed Jul 28, 2024
1 parent 2e61d8e commit ef01369
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/pynxtools/dataconverter/readers/multi/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,17 +170,14 @@ def parse_config_value(value: str) -> Tuple[str, Any]:
"""
# Regex pattern to match @prefix:some_string
pattern = r"!?(@\w+)(?::(.*))?"
pattern = r"(@\w+)(?::(.*))?"
prefixes = re.findall(pattern, value)
if not prefixes:
return ("", value)
return prefixes[0]

# Handle non-keyword values
if not isinstance(value, str) or "@" not in str(value):
if isinstance(value, str):
# Handle "!" notation for required fields in optional groups
value = value.lstrip("!")
new_entry_dict[key] = value
return

Expand Down

0 comments on commit ef01369

Please sign in to comment.