|
7 | 7 | from __future__ import print_function, division, unicode_literals, absolute_import
|
8 | 8 | from builtins import str, open, map, next, zip, range
|
9 | 9 |
|
| 10 | +import sys |
10 | 11 | from future import standard_library
|
11 | 12 | standard_library.install_aliases()
|
12 | 13 | from collections import defaultdict
|
@@ -330,6 +331,9 @@ def _get_valid_pathstr(pathstr):
|
330 | 331 | Replaces: ',' -> '.'
|
331 | 332 | """
|
332 | 333 | pathstr = pathstr.replace(os.sep, '..')
|
| 334 | + if sys.version_info[0] < 3: |
| 335 | + # Remove those u'string' patterns |
| 336 | + pathstr = re.sub(r'''([^\w])u['"]([\w\d -\.:;,]*)['"]''', r'\1\2', pathstr) |
333 | 337 | pathstr = re.sub(r'''[][ (){}?:<>#!|"';]''', '', pathstr)
|
334 | 338 | pathstr = pathstr.replace(',', '.')
|
335 | 339 | return pathstr
|
@@ -515,9 +519,11 @@ def _merge_graphs(supergraph, nodes, subgraph, nodeid, iterables,
|
515 | 519 | rootnode = Gc.nodes()[nodeidx]
|
516 | 520 | paramstr = ''
|
517 | 521 | for key, val in sorted(params.items()):
|
518 |
| - paramstr = '_'.join((paramstr, _get_valid_pathstr(key), |
519 |
| - _get_valid_pathstr(str(val)))) |
| 522 | + paramstr = '{}_{}_{}'.format( |
| 523 | + paramstr, _get_valid_pathstr(key), _get_valid_pathstr(str(val))) |
520 | 524 | rootnode.set_input(key, val)
|
| 525 | + |
| 526 | + logger.debug('Parameterization: paramstr=%s', paramstr) |
521 | 527 | levels = get_levels(Gc)
|
522 | 528 | for n in Gc.nodes():
|
523 | 529 | """
|
|
0 commit comments