Update SurfaceContactCommand to use flexible column/info names.
[hooke.git] / hooke / util / si.py
index 6108b9fd1efb1f1f0270f6ade2fc9c48a548949d..48fe4e0c87d7fbb1f725a382325f8223edbb30b7 100644 (file)
@@ -166,8 +166,28 @@ def prefix_from_value(value):
     """
     return PREFIX[get_power(value)]
 
+def join_data_label(name, unit):
+    """Create laels for `curve.data[i].info['columns']`.
+
+    See Also
+    --------
+    split_data_label
+
+    Examples
+    --------
+    >>> join_data_label('z piezo', 'm')
+    'z piezo (m)'
+    >>> join_data_label('deflection', 'N')
+    'deflection N'
+    """
+    return '%s (%s)' % (name, unit)
+
 def split_data_label(label):
-    """Split `curve.data[i].info['name']` labels into `(name, unit)`.
+    """Split `curve.data[i].info['columns']` labels into `(name, unit)`.
+
+    See Also
+    --------
+    join_data_label
 
     Examples
     --------