def get_axes_names(composite_axis_name: str):
// TODO add spaces and long names
elementary_axes = []
composite_axis_name = list(composite_axis_name)
while len(composite_axis_name) > 0:
letter = composite_axis_name.pop()
if "a" <= letter <= "z" or letter == "_":
elementary_axes.append(letter)
After Change
def get_axes_names(composite_axis_name: str):
axes_names = [axis for axis in composite_axis_name.split(" ") if len(axis) > 0]
for axis in axes_names:
if axis == "_":
continue
assert "a" <= axis[0] <= "z"
for letter in axis:
assert str.isdigit(letter) or "a" <= letter <= "z"
return axes_names