Skip to content

Commit bca55dd

Browse files
Apply suggestions from code review
Co-authored-by: RubelMozumder <32923026+RubelMozumder@users.noreply.github.com>
1 parent 6a9db11 commit bca55dd

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

src/pynxtools/dataconverter/helpers.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,8 +1193,6 @@ def clean_str_attr(
11931193
Return the attribute as a string.
11941194
11951195
- If `attr` is `bytes`, decode it using the given encoding.
1196-
- If `attr` is already a string, return it unchanged.
1197-
- If `attr` is `None`, return `None`.
11981196
- Otherwise, return it unchanged.
11991197
12001198
Args:
@@ -1204,8 +1202,6 @@ def clean_str_attr(
12041202
Returns:
12051203
The attribute as a string, or None if input was None.
12061204
"""
1207-
if attr is None or isinstance(attr, str):
1208-
return attr
12091205
if isinstance(attr, bytes):
12101206
return attr.decode(encoding)
12111207
return attr

src/pynxtools/dataconverter/nexus_tree.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ def get_all_direct_children_names(
363363
tag_type = f"[@type='{nx_class}']"
364364

365365
if node_type is not None:
366-
search_tags = f"*[self::nx:{node_type}{tag_type}]"
366+
search_tags = rf"*[self::nx:{node_type}{tag_type}]"
367367
else:
368368
search_tags = (
369369
r"*[self::nx:field or self::nx:group "

0 commit comments

Comments
 (0)