Format docstrings in scalar.py