Skip to content

Commit

Permalink
rename variable to affix_no_trailing_space
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelLucaAdams committed Nov 19, 2024
1 parent 10ac191 commit 0c7aea6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/sdf_xarray/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,14 +256,14 @@ def _process_latex_name(variable_name: str) -> str:
for prefix in prefixes:
for suffix in suffixes:
affix_spaces = f" {prefix}{suffix} "
affix_no_spaces = f" {prefix}{suffix}"
affix_no_trailing_space = f" {prefix}{suffix}"
if affix_spaces in variable_name:
return variable_name.replace(
affix_spaces, f" {prefix}$_{suffix} $"
)
elif affix_no_spaces in variable_name:
elif affix_no_trailing_space in variable_name:
return variable_name.replace(
affix_no_spaces, f" {prefix}$_{suffix}$"
affix_no_trailing_space, f" {prefix}$_{suffix}$"
)
return variable_name

Expand Down

0 comments on commit 0c7aea6

Please sign in to comment.