diff --git a/pybop/_utils.py b/pybop/_utils.py index 426b0d277..c09991b30 100644 --- a/pybop/_utils.py +++ b/pybop/_utils.py @@ -1,3 +1,4 @@ +import re from typing import Optional import numpy as np @@ -11,6 +12,15 @@ def is_numeric(x): return isinstance(x, (int, float, np.number)) +def add_spaces(string): + """ + Return the class name as a string with spaces before each new capitalised word. + """ + re_outer = re.compile(r"([^A-Z ])([A-Z])") + re_inner = re.compile(r"(?