Skip to content

Commit cfc6599

Browse files
committed
Added partition property to rect
1 parent 9b9df40 commit cfc6599

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

MLStructFP/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
__description__ = 'Machine learning structural floor plan dataset'
1010
__keywords__ = ['ml', 'ai', 'floor plan', 'architectural', 'dataset', 'cnn']
1111
__email__ = '[email protected]'
12-
__version__ = '0.6.9'
12+
__version__ = '0.7.0'
1313

1414
# URL
1515
__url__ = 'https://github.com/MLSTRUCT/MLSTRUCT-FP'

MLStructFP/db/_c_rect.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class Rect(BaseComponent):
2424
angle: float
2525
length: float
2626
line: GeomLine2D
27+
partition: bool
2728
thickness: float
2829
wall: int
2930

@@ -39,7 +40,8 @@ def __init__(
3940
y: List[float],
4041
line_m: NumberType,
4142
line_n: NumberType,
42-
line_theta: NumberType
43+
line_theta: NumberType,
44+
partition: bool
4345
) -> None:
4446
"""
4547
Constructor.
@@ -55,6 +57,7 @@ def __init__(
5557
:param line_m: Line slope
5658
:param line_n: Line intercept
5759
:param line_theta: Line angle
60+
:param partition: Rect is partition wall
5861
"""
5962
BaseComponent.__init__(self, rect_id, x, y, floor)
6063
assert isinstance(wall_id, int) and wall_id > 0
@@ -63,12 +66,14 @@ def __init__(
6366
assert isinstance(line_m, NumberInstance)
6467
assert isinstance(line_n, NumberInstance)
6568
assert isinstance(line_theta, NumberInstance)
69+
assert isinstance(partition, bool)
6670
self.angle = float(angle)
6771
self.length = float(length)
6872
self.line = GeomLine2D()
6973
self.line.m = float(line_m)
7074
self.line.n = float(line_n)
7175
self.line.theta = float(line_theta)
76+
self.partition = partition
7277
self.thickness = float(thickness)
7378
self.wall = wall_id
7479
# noinspection PyProtectedMember

MLStructFP/db/_db_loader.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ def __init__(self, db: str, floor_only: bool = False) -> None:
104104
y=rect_data['y'],
105105
line_m=rect_data['line'][0], # Slope
106106
line_n=rect_data['line'][1], # Intercept
107-
line_theta=rect_data['line'][2] # Theta
107+
line_theta=rect_data['line'][2], # Theta
108+
partition=rect_data['partition'] if 'partition' in rect_data else False # Is partition
108109
)
109110
for point_id in data.get('point', {}):
110111
point_data: dict = data['point'][point_id]
@@ -246,7 +247,8 @@ def hist(self,
246247
if f_filter is not None and not f_filter(f):
247248
continue
248249
fh = f_hist(f)
249-
assert isinstance(fh, list), f'f_hist must return a list of categories to assemble histogram, "{fh}" is not allowed'
250+
assert isinstance(fh,
251+
list), f'f_hist must return a list of categories to assemble histogram, "{fh}" is not allowed'
250252
for c in fh:
251253
assert isinstance(c, str), f'f_hist must return only strings, "{c}" is not allowed'
252254
cat.append(c)

0 commit comments

Comments
 (0)