Beispiel #1
0
def test_label_name_with_unit():
    var = sc.Variable(['x'], values=np.random.random(10), unit=sc.units.counts)
    assert su.name_with_unit(var, name='sample') == 'sample [counts]'
Beispiel #2
0
def test_label_name_only():
    assert su.name_with_unit(name='My name') == 'My name'
Beispiel #3
0
def test_label_var_with_unit_with_log():
    var = sc.Variable(['x'], values=np.random.random(10), unit=sc.units.m)
    assert su.name_with_unit(var, log=True) == 'log\u2081\u2080(x) [m]'
Beispiel #4
0
def test_label_var_no_unit():
    var = sc.Variable(['x'], values=np.random.random(10))
    assert su.name_with_unit(var) == 'x [dimensionless]'
Beispiel #5
0
def test_label_var_with_unit():
    var = sc.Variable(['x'], values=np.random.random(10), unit=sc.units.m)
    assert su.name_with_unit(var) == 'x [m]'