forked from ladybug-tools/honeybee-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaltnumber.py
47 lines (31 loc) · 1002 Bytes
/
altnumber.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
"""Objects used as alternatives to various numerical properties."""
class _AltNumber(object):
__slots__ = ()
def __init__(self):
pass
@property
def name(self):
return self.__class__.__name__
def to_dict(self):
"""Get the object as a dictionary."""
return {'type': self.name}
def ToString(self):
return self.__repr__()
def __eq__(self, other):
return self.__class__ == other.__class__
def __ne__(self, other):
return not self.__eq__(other)
def __repr__(self):
return self.name
class NoLimit(_AltNumber):
"""Object representing no limit to a certain numerical value."""
__slots__ = ()
pass
class Autocalculate(_AltNumber):
"""Object representing when a certain numerical value is automatically calculated.
Typically, this means that the value is determined from other variables.
"""
__slots__ = ()
pass
no_limit = NoLimit()
autocalculate = Autocalculate()