Last change
on this file since 1325 was
1185,
checked in by Maciej Komosinski, 2 years ago
|
Renamed a module; new name is "evolalg_steps"
|
File size:
447 bytes
|
Line | |
---|
1 | from typing import Iterable, Union, List |
---|
2 | |
---|
3 | from evolalg_steps.base.step import Step |
---|
4 | import copy |
---|
5 | |
---|
6 | def propagate_names(step: Step, prefix=""): |
---|
7 | |
---|
8 | if isinstance(step, Iterable): |
---|
9 | for s in step: |
---|
10 | if hasattr(step, "name"): |
---|
11 | propagate_names(s, prefix=prefix + "." + step.name) |
---|
12 | else: |
---|
13 | propagate_names(s, prefix=prefix) |
---|
14 | if hasattr(step, "name"): |
---|
15 | step.name = f"{prefix}.{step.name}" |
---|
Note: See
TracBrowser
for help on using the repository browser.