Skip to content

Commit

Permalink
Added scale limits
Browse files Browse the repository at this point in the history
  • Loading branch information
ppizarror committed Apr 1, 2024
1 parent e09a0cf commit 1966ee3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion MLStructFP/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
__description__ = 'Machine learning structural floor plan dataset'
__keywords__ = ['ml', 'ai', 'dataset', 'calc', 'matrix analysis', 'cnn', 'structural analysis', 'structural design']
__email__ = '[email protected]'
__version__ = '0.5.6'
__version__ = '0.5.7'

# URL
__url__ = 'https://github.com/MLSTRUCT/MLSTRUCT-FP'
Expand Down
10 changes: 10 additions & 0 deletions MLStructFP/db/_db_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from MLStructFP._types import Tuple

import json
import math
import os
import tabulate

Expand Down Expand Up @@ -110,6 +111,15 @@ def floors(self) -> Tuple['Floor', ...]:
def path(self) -> str:
return self.__path

@property
def scale_limits(self) -> Tuple[float, float]:
sc_min = math.inf
sc_max = 0
for f in self.floors:
sc_min = min(sc_min, f.image_scale)
sc_max = max(sc_max, f.image_scale)
return sc_min, sc_max

def set_filter(self, f_filter: Callable[['Floor'], bool]) -> None:
"""
Set floor filter.
Expand Down

0 comments on commit 1966ee3

Please sign in to comment.