Skip to content

Commit

Permalink
[parameter-sweep] recognize 3e4name as float parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
nikohansen committed Jan 23, 2025
1 parent 2e8df12 commit 2ab781c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/cocopp/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,16 @@ def _str_to_colormap(s, len_):
def _index_after_parameter(name):
"""return the first index after a sequence of '0'-'9' or '.' chars"""
found = False
exponent = False
for i in range(len(name)):
if '0' <= name[i] <= '9' or name[i] == '.':
if '0' <= name[i] <= '9' or (name[i] == '.' and not exponent):
found = True
continue
elif found and not exponent and name[i].lower() == 'e':
exponent = True
continue
elif found:
return i
return i if name[i-1].lower() != 'e' else i - 1
return -1

def map_indices_to_line_styles(names):
Expand Down

0 comments on commit 2ab781c

Please sign in to comment.