-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
88 lines (85 loc) · 2.16 KB
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
from cubit._base import Default
print(None)
print(Default)
print("--------")
print(str(None))
print(str(Default))
print("--------")
print(repr(None))
print(repr(Default))
print("--------")
print(None is None)
print(Default == Default)
print("--------")
print(None is None)
print(Default is Default)
print("--------")
print(dir(None))
print(dir(Default))
print("--------")
print(type(None))
print(type(Default))
print("--------")
print(bool(None))
print(bool(Default))
print("--------")
# from rich.console import Console
# from rich.markup import escape
# from rich.table import Table
#
# import cubit.units
# from cubit.system import UNIT_REGISTRY
# from cubit.units import CompositeUnit, Unit
#
#
# console = Console()
#
# table = Table(title="Base Units")
#
# table.add_column("Name")
# table.add_column("Type")
# table.add_column("Symbol")
# table.add_column("Representation")
# table.add_column("Decomposition")
# table.add_column("Decomposed Type")
# for k, v in dict(UNIT_REGISTRY).items():
# if (
# isinstance(v, Unit)
# and v.referent is None
# and v.scaling_factor == cubit.units.uni
# ):
# d_v = v.decompose()
# table.add_row(
# v.name,
# type(v).__qualname__,
# repr(k),
# escape(repr(v)),
# escape(repr(d_v)),
# type(d_v).__qualname__,
# )
# console.print(table)
#
# table = Table(title="Derived Units with Special Names")
# table.add_column("Name")
# table.add_column("Type")
# table.add_column("Symbol")
# table.add_column("Representation")
# table.add_column("Decomposition")
# table.add_column("Decomposed Type")
# for k, v in dict(UNIT_REGISTRY).items():
# if (
# isinstance(v, CompositeUnit)
# and (
# any(u.referent is not None for u in v.component_units) or v.name is not None
# )
# ) or (isinstance(v, Unit) and v.referent is not None):
# d_v = v.decompose()
# table.add_row(
# v.name,
# type(v).__qualname__,
# repr(k),
# escape(repr(v)),
# escape(repr(d_v)),
# type(d_v).__qualname__,
# )
# console.print(table)